2 Copyright 2013 Oleg Kostyuk <cub.uanic@gmail.com>
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #include <util/delay.h>
18 #include "bootloader.h"
19 #include "keymap_common.h"
22 const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
23 KEYMAP( // layer 0 : default
25 EQL, 1, 2, 3, 4, 5, ESC,
26 BSLS,Q, W, E, R, T, FN2,
28 LSFT,Z, X, C, V, B, FN1,
29 LGUI,GRV, BSLS,LEFT,RGHT,
34 FN3, 6, 7, 8, 9, 0, MINS,
35 LBRC,Y, U, I, O, P, RBRC,
36 H, J, K, L, SCLN,QUOT,
37 FN1, N, M, COMM,DOT, SLSH,RSFT,
38 LEFT,DOWN,UP, RGHT,RGUI,
44 KEYMAP( // layer 1 : function and symbol keys
46 TRNS,F1, F2, F3, F4, F5, F11,
47 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,FN4,
48 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
49 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
50 TRNS,TRNS,TRNS,TRNS,TRNS,
55 F12, F6, F7, F8, F9, F10, TRNS,
56 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
57 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
58 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
59 TRNS,TRNS,TRNS,TRNS,TRNS,
65 KEYMAP( // layer 2 : keyboard functions
67 FN0, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
68 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
69 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
70 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
71 TRNS,TRNS,TRNS,TRNS,TRNS,
76 FN4, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
77 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
78 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
79 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
80 TRNS,TRNS,TRNS,TRNS,TRNS,
86 KEYMAP( // layer 3: numpad
88 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
89 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
90 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
91 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
92 TRNS,TRNS,TRNS,TRNS,TRNS,
97 TRNS,NLCK,PSLS,PAST,PAST,PMNS,BSPC,
98 TRNS,NO, P7, P8, P9, PMNS,BSPC,
99 NO, P4, P5, P6, PPLS,PENT,
100 TRNS,NO, P1, P2, P3, PPLS,PENT,
101 P0, PDOT,SLSH,PENT,PENT,
109 /* id for user defined functions */
115 * Fn action definition
117 const uint16_t PROGMEM fn_actions[] = {
118 ACTION_FUNCTION(TEENSY_KEY), // FN0 - Teensy key
119 ACTION_LAYER_MOMENTARY(1), // FN1 - switch to Layer1
120 ACTION_LAYER_SET(2, ON_PRESS), // FN2 - set Layer2
121 ACTION_LAYER_TOGGLE(3), // FN3 - toggle Layer3 aka Numpad layer
122 ACTION_LAYER_SET(0, ON_PRESS), // FN4 - set Layer0
125 void action_function(keyrecord_t *event, uint8_t id, uint8_t opt)
127 if (id == TEENSY_KEY) {
129 print("\n\nJump to bootloader... ");
131 bootloader_jump(); // should not return
132 print("not supported.\n");