-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathkeymap.c
360 lines (341 loc) · 12 KB
/
keymap.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
/*******************************************
* QMK firmware for a let's split keyboard
*
* William Wilson
* June 16, 2017
******************************************/
#include "lets_split.h"
#include "action_layer.h"
#include "eeconfig.h"
extern keymap_config_t keymap_config;
#define _DVORAK 0
#define _NUMPAD 1
#define _SYMBOLS 2
#define _FN 3
#define _MACROS 4
#define _QWERTY 5
#define _QNUMPAD 6
#define _QSYMBOLS 7
#define _QFN 8
#define _QMACROS 9
#define KC_ KC_TRNS
#define _______ KC_TRNS
#define KC_NMPD TG(_NUMPAD)
#define KC_SYMB TG(_SYMBOLS)
#define KC_QNUM TG(_QNUMPAD)
#define KC_QSYM TG(_QSYMBOLS)
#define KC_QSFN LT(_QFN,KC_MINS)
#define KC_SPFN LT(_FN,KC_MINS)
#define KC_SPCT MT(MOD_LCTL, KC_BSLS)
#define KC_SPLT MT(MOD_LALT, KC_EQL)
#define KC_GBRC MT(MOD_RGUI, KC_RBRC)
#define KC_MESC LT(_MACROS, KC_ESC)
#define KC_QESC LT(_QMACROS, KC_ESC)
#define KC_GLPK M(0)
#define KC_JERY M(1)
#define KC_IMGR M(2)
#define KC_INCL M(3)
#define KC_EML M(4)
#define KC_PULL M(5)
#define KC_PUSH M(6)
#define KC_SPCS M(7)
#define KC_PSWD M(8)
#define KC_DNCU M(9)
#define KC_DNCD M(10)
#define KC_DSCU M(11)
#define KC_DSCD M(12)
#define KC_QNCU M(13)
#define KC_QNCD M(14)
#define KC_QSCU M(15)
#define KC_QSCD M(16)
#define KC_QWCU M(17)
#define KC_QWCD M(18)
#define KC_LTOG M(19)
#define KC_STEP M(20)
#define KC_CAD LALT(LCTL(KC_DEL))
#define KC_LOCK LGUI(KC_L)
#define KC_DVRK TO(_DVORAK)
#define KC_QWRT TO(_QWERTY)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_DVORAK] = KC_KEYMAP(
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
MESC,QUOT,COMM,DOT , P , Y , F , G , C , R , L ,SLSH,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
TAB , A , O , E , U , I , D , H , T , N , S , ENT,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
LSPO,SCLN, Q , J , K , X , B , M , W , V , Z ,RSPC,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
SPCT,SPFN,SPLT,AMPR,DNCU,BSPC, SPC ,DSCU,ASTR,EXLM,LBRC,GBRC
//`----+----+----+----+----+----' `----+----+----+----+----+----'
),
[_NUMPAD] = KC_KEYMAP(
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
, , , , , , , 7 , 8 , 9 ,MINS,SLSH,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
, , , , , , , 4 , 5 , 6 ,PLUS, ENT,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
LSFT, , , , , , , 1 , 2 , 3 ,ASTR, EQL,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
, , , ,DNCD,BSPC, SPC , 0 , 0 , DOT,SLSH,RGUI
//`----+----+----+----+----+----' `----+----+----+----+----+----'
),
[_SYMBOLS] = KC_KEYMAP(
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,SLSH,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
F1 , F2 , F3 , F4 , F5 , F6 , TILD,EQL ,UNDS,LCBR,RCBR,PIPE,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
F7 , F8 , F9 , F10, F11, F12, GRV ,PLUS,MINS,LBRC,RBRC,BSLS,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
, , , , NO ,BSPC, SPC ,DSCD, , , ,RGUI
//`----+----+----+----+----+----' `----+----+----+----+----+----'
),
[_FN] = KC_KEYMAP(
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
, , , , DEL,BSPC, ,HOME, UP , END, INS,PSCR,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
, , ,LSFT,LCTL, ENT, ,LEFT,DOWN,RGHT, DEL, ,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
, , , , , , ,PGUP,PGDN, , , ,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
, , , , ,DEL , , , , , ,
//`----+----+----+----+----+----' `----+----+----+----+----+----'
),
[_MACROS] = KC_KEYMAP(
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
, ,PULL,PUSH,PSWD, , ,GLPK, , ,IMGR,QWCU,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
, , ,EML , ,INCL, CAD , , , , , ,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
, , ,JERY, , , , , , , , ,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
LTOG, , , , ,STEP, SPCS, , , , ,
//`----+----+----+----+----+----' `----+----+----+----+----+----'
),
[_QWERTY] = KC_KEYMAP(
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
QESC, Q , W , E , R , T , Y , U , I , O , P ,QUOT,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
TAB , A , S , D , F , G , H , J , K , L ,SCLN, ENT,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
LSPO, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH,RSPC,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
SPCT,QSFN,SPLT,AMPR,QNCU,BSPC, SPC ,QSCU,ASTR,EXLM,LBRC,GBRC
//`----+----+----+----+----+----' `----+----+----+----+----+----'
),
[_QNUMPAD] = KC_KEYMAP(
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
, , , , , , , 7 , 8 , 9 ,MINS,QUOT,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
, , , , , , , 4 , 5 , 6 ,PLUS, ENT,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
LSFT, , , , , , , 1 , 2 , 3 ,ASTR, EQL,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
, , , ,QNCD,BSPC, SPC , 0 , 0 , DOT,SLSH,RGUI
//`----+----+----+----+----+----' `----+----+----+----+----+----'
),
[_QSYMBOLS] = KC_KEYMAP(
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,QUOT,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
F1 , F2 , F3 , F4 , F5 , F6 , TILD,EQL ,UNDS,LCBR,RCBR,PIPE,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
F7 , F8 , F9 , F10, F11, F12, GRV ,PLUS,MINS,LBRC,RBRC,BSLS,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
, , , , NO ,BSPC, SPC ,QSCD, , , ,RGUI
//`----+----+----+----+----+----' `----+----+----+----+----+----'
),
[_QFN] = KC_KEYMAP(
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
, , , , DEL,BSPC, ,HOME, UP , END, INS,PSCR,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
, , ,LSFT,LCTL, ENT, ,LEFT,DOWN,RGHT, DEL, ,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
, , , , , , ,PGUP,PGDN, , , ,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
, , , , ,DEL , , , , , ,
//`----+----+----+----+----+----' `----+----+----+----+----+----'
),
[_QMACROS] = KC_KEYMAP(
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
, , ,EML , , , , ,INCL, ,PSWD,QWCD,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
, , ,CAD , ,GLPK, ,JERY, ,IMGR, , ,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
, , , , , , , ,PULL,PUSH, , ,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
, , , , , , SPCS, , , , ,
//`----+----+----+----+----+----' `----+----+----+----+----+----'
)
};
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) // this is the function signature -- just copy/paste it into your keymap file as it is.
{
switch(id) {
case 0: // this would trigger when you hit a key mapped as M(0)
if (record->event.pressed) {
SEND_STRING("GlenPickle");
return false; // This is false because it has to return something.
}
break;
case 1:
if (record->event.pressed) {
SEND_STRING("My friend Louisa got straight A's all the way from kindergarten to her PhD. One day while we were out biking in Europe we ran into John Nash knife fighting with Sifu. I was busy fighting a student of mine with my Aikido, or else I would have hypnotized both John Nash and Sifu. I HATE A WHITE SAUCE.");
return false;
}
break;
case 2:
if (record->event.pressed) {
SEND_STRING("http://imgur.com/gallery/PRDJm");
return false;
}
break;
case 3:
if (record->event.pressed) {
SEND_STRING("#include<>");
return false;
}
break;
case 4:
if (record->event.pressed) {
SEND_STRING("[email protected]");
return false;
}
break;
case 5:
if (record->event.pressed) {
SEND_STRING("git pull");
return MACRO( T(ENT), END );
}
break;
case 6:
if (record->event.pressed){
SEND_STRING("git push");
return MACRO( T(ENT), END );
}
break;
case 7:
if (record->event.pressed){
SEND_STRING(" ");
return false;
}
break;
case 8:
if (record->event.pressed){
SEND_STRING("asdfASDFasdf12!@");
return MACRO ( T(ENT), END );
}
break;
case 9:
if (record->event.pressed){
layer_on(_NUMPAD);
#ifdef RGBLIGHT_ENABLE
rgblight_setrgb(0x00,0x00,0xff);
#endif
return false;
}
break;
case 10:
if (record->event.pressed){
layer_off(_NUMPAD);
#ifdef RGBLIGHT_ENABLE
rgblight_setrgb(0x00,0xff,0x00);
#endif
return false;
}
break;
case 11:
if (record->event.pressed){
layer_on(_SYMBOLS);
#ifdef RGBLIGHT_ENABLE
rgblight_setrgb(0xff,0x00,0x00);
#endif
return false;
}
break;
case 12:
if (record->event.pressed){
layer_off(_SYMBOLS);
#ifdef RGBLIGHT_ENABLE
rgblight_setrgb(0x00,0xff,0x00);
#endif
return false;
}
break;
case 13:
if (record->event.pressed){
layer_on(_QNUMPAD);
#ifdef RGBLIGHT_ENABLE
rgblight_setrgb(0x00,0x00,0xff);
#endif
return false;
}
break;
case 14:
if (record->event.pressed){
layer_off(_QNUMPAD);
#ifdef RGBLIGHT_ENABLE
rgblight_setrgb(0xff,0x00,0xff);
#endif
return false;
}
break;
case 15:
if (record->event.pressed){
layer_on(_QSYMBOLS);
#ifdef RGBLIGHT_ENABLE
rgblight_setrgb(0xff,0x00,0x00);
#endif
return false;
}
break;
case 16:
if (record->event.pressed){
layer_off(_QSYMBOLS);
#ifdef RGBLIGHT_ENABLE
rgblight_setrgb(0xff,0x00,0xff);
#endif
return false;
}
break;
case 17:
if (record->event.pressed){
layer_on(_QWERTY);
#ifdef RGBLIGHT_ENABLE
rgblight_setrgb(0xff,0x00,0xff);
#endif
return false;
}
break;
case 18:
if (record->event.pressed){
layer_off(_QMACROS);
layer_off(_QWERTY);
#ifdef RGBLIGHT_ENABLE
rgblight_setrgb(0x00,0xff,0x00);
#endif
return false;
}
break;
case 19:
if (record->event.pressed){
rgblight_toggle();
return false;
}
break;
case 20:
if (record->event.pressed){
#ifdef RGBLIGHT_ENABLE
rgblight_step();
#endif
return false;
}
break;
}
return MACRO_NONE;
};
void matrix_init_user(void)
{
/* turn to green */
rgblight_mode(1);
rgblight_setrgb(0x00,0xff,0x00);
}