]> git.gir.st - tmk_keyboard.git/blob - keyboard/ergodox/keymap_blazak.c
build with ./make and flash with ./make flash
[tmk_keyboard.git] / keyboard / ergodox / keymap_blazak.c
1 /*
2 Copyright 2013 Oleg Kostyuk <cub.uanic@gmail.com>
3
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.
8
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.
13
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/>.
16 */
17 #include <util/delay.h>
18 #include "bootloader.h"
19 #include "keymap_common.h"
20
21
22 const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
23 KEYMAP( // layer 0 : default
24 // left hand
25 EQL, 1, 2, 3, 4, 5, ESC,
26 BSLS,Q, W, E, R, T, FN2,
27 TAB, A, S, D, F, G,
28 LSFT,Z, X, C, V, B, FN1,
29 LGUI,GRV, BSLS,LEFT,RGHT,
30 LCTL,LALT,
31 HOME,
32 BSPC,DEL, END,
33 // right hand
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,
39 RALT,RCTL,
40 PGUP,
41 PGDN,ENT, SPC
42 ),
43
44 KEYMAP( // layer 1 : function and symbol keys
45 // left hand
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,
51 TRNS,TRNS,
52 TRNS,
53 TRNS,TRNS,TRNS,
54 // right hand
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,
60 TRNS,TRNS,
61 TRNS,
62 TRNS,TRNS,TRNS
63 ),
64
65 KEYMAP( // layer 2 : keyboard functions
66 // left hand
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,
72 TRNS,TRNS,
73 TRNS,
74 TRNS,TRNS,TRNS,
75 // right hand
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,
81 TRNS,TRNS,
82 TRNS,
83 TRNS,TRNS,TRNS
84 ),
85
86 KEYMAP( // layer 3: numpad
87 // left hand
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,
93 TRNS,TRNS,
94 TRNS,
95 TRNS,TRNS,TRNS,
96 // right hand
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,
102 TRNS,TRNS,
103 TRNS,
104 TRNS,TRNS,TRNS
105 ),
106
107 };
108
109 /* id for user defined functions */
110 enum function_id {
111 TEENSY_KEY,
112 };
113
114 /*
115 * Fn action definition
116 */
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
123 };
124
125 void action_function(keyrecord_t *event, uint8_t id, uint8_t opt)
126 {
127 if (id == TEENSY_KEY) {
128 clear_keyboard();
129 print("\n\nJump to bootloader... ");
130 _delay_ms(250);
131 bootloader_jump(); // should not return
132 print("not supported.\n");
133 }
134 }
Imprint / Impressum