-
Notifications
You must be signed in to change notification settings - Fork 0
/
keymap.c
404 lines (355 loc) · 18.2 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
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
/*
Copyright 2019 @foostan
Copyright 2020 Drashna Jaelre <@drashna>
Copyright 2021 Arda Kilicdagi <GH: @ardakilic, TW: @ardadev>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
// animation vars
#define ANIM_INVERT false
#define ANIM_RENDER_WPM true
#define FAST_TYPE_WPM 45 //Switch to fast animation when over words per minute
//custom codes
#define CTL_A LCTL_T(KC_A)
#define ALT_S LALT_T(KC_S)
#define CMD_D LGUI_T(KC_D)
#define SFT_F LSFT_T(KC_F)
#define CTL_QUOTE RCTL_T(KC_QUOT)
#define ALT_L RALT_T(KC_L)
#define CMD_K RGUI_T(KC_K)
#define SFT_J RSFT_T(KC_J)
#define XXX KC_NO
#define HMRW S(G(KC_SPC))
#define ALF A(KC_SPC)
#define MEDI_ESC LT(_MEDIA, KC_ESC)
#define NAV_SPC LT(_NAV, KC_SPC)
#define TIL_TAB LT(_TILNAV, KC_TAB)
#define SYM_ENT LT(_SYM, KC_ENT)
#define NUM_BSP LT(_NUM, KC_BSPC)
#define FUN_DEL LT(_FUN, KC_DEL)
#define SAVE G(KC_S)
#define PASTE TD(TD_ALFRED_PASTE)
#define COPY G(KC_C)
#define CUT G(KC_X)
#define UNDO G(KC_Z)
#define MOV_WES A(KC_F16)
#define MOV_SOU A(KC_F15)
#define MOV_NOR A(KC_F14)
#define MOV_EAS A(KC_F13)
#define FUL_FLO TD(TD_FULL_FLOAT)
#define MVW_1 S(A(KC_1))
#define MVW_2 S(A(KC_2))
#define MVW_3 S(A(KC_3))
#define MVW_4 S(A(KC_4))
#define MVW_5 S(A(KC_5))
#define MVW_6 S(A(KC_6))
#define MVW_7 S(A(KC_7))
#define MVW_8 S(A(KC_8))
#define MVW_9 S(A(KC_9))
#define FCW_1 C(KC_1)
#define FCW_2 C(KC_2)
#define FCW_3 C(KC_3)
#define FCW_4 C(KC_4)
#define FCW_5 C(KC_5)
#define FCW_6 C(KC_6)
#define FCW_7 C(KC_7)
#define FCW_8 C(KC_8)
#define FCW_9 C(KC_9)
#define MVW_LEF G(A(KC_F16))
#define MVW_RIG G(A(KC_F13))
#define FCS_MV1 TD(TD_MVW_1)
#define FCS_MV2 TD(TD_MVW_2)
#define FCS_MV3 TD(TD_MVW_3)
#define FCS_MV4 TD(TD_MVW_4)
#define FCS_MV5 TD(TD_MVW_5)
#define FCS_MV6 TD(TD_MVW_6)
#define FCS_MV7 TD(TD_MVW_7)
#define FCS_MV8 TD(TD_MVW_8)
#define FCS_MV9 TD(TD_MVW_9)
// Layers
enum {
_QWERTY,
_MEDIA,
_NAV,
_TILNAV,
_SYM,
_NUM,
_FUN
};
enum {
TD_ALFRED_PASTE, TD_SCREEN, TD_FULL_FLOAT, TD_MVW_1, TD_MVW_2, TD_MVW_3, TD_MVW_4, TD_MVW_5, TD_MVW_6, TD_MVW_7, TD_MVW_8, TD_MVW_9
};
enum custom_keycodes {
CURLIES = SAFE_RANGE,
SQUARES,
BRACKETS
};
tap_dance_action_t tap_dance_actions[] = {
[TD_ALFRED_PASTE] = ACTION_TAP_DANCE_DOUBLE( G(KC_V) , G(A(KC_V)) ),
[TD_SCREEN] = ACTION_TAP_DANCE_DOUBLE( S(G(KC_4)) , S(G(C(KC_4))) ),
[TD_FULL_FLOAT] = ACTION_TAP_DANCE_DOUBLE( A(KC_F18), C(A(KC_F18))),
[TD_MVW_1] = ACTION_TAP_DANCE_DOUBLE(MVW_1, FCW_1),
[TD_MVW_2] = ACTION_TAP_DANCE_DOUBLE(MVW_2, FCW_2),
[TD_MVW_3] = ACTION_TAP_DANCE_DOUBLE(MVW_3, FCW_3),
[TD_MVW_4] = ACTION_TAP_DANCE_DOUBLE(MVW_4, FCW_4),
[TD_MVW_5] = ACTION_TAP_DANCE_DOUBLE(MVW_5, FCW_5),
[TD_MVW_6] = ACTION_TAP_DANCE_DOUBLE(MVW_6, FCW_6),
[TD_MVW_7] = ACTION_TAP_DANCE_DOUBLE(MVW_7, FCW_7),
[TD_MVW_8] = ACTION_TAP_DANCE_DOUBLE(MVW_8, FCW_8),
[TD_MVW_9] = ACTION_TAP_DANCE_DOUBLE(MVW_9, FCW_9),
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*
* BASE LAYER
[_QWERTY] = LAYOUT_wrapper( \
//,-----------------------------------------------------. ,----------------------------------------------------.
| hmrw | Q | W | E | R | T | | Y | U | I | O | P | Alfr |
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+-------|
| ------ | A | S | D | F | G | | H | J | K | L | ' | ; |
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+-------|
| SftCaps| Z | X | C | V | B | | N | M | , | . | / | ----- |
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+-------|
,-----------------------, ,-----------------------.
|Med/Esc|Nav/Spc|Til/Tab| |Sym/Ent|Num/Bsp|Fun/Del|
/|-------+-------+-------' +-------+-------+-------|\
),
*/
[_QWERTY] = LAYOUT_split_3x6_3(
HMRW, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, ALF,
_______, CTL_A, ALT_S, CMD_D, SFT_F, KC_G, KC_H, SFT_J, CMD_K, ALT_L, CTL_QUOTE, KC_SCLN,
TD(TD_SCREEN), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______, /*KC_ENT*/
MEDI_ESC, NAV_SPC, TIL_TAB, SYM_ENT, NUM_BSP, FUN_DEL
),
/*
* Media LAYER
[_MEDIA] = LAYOUT_wrapper( \
//,-----------------------------------------------------. ,-----------------------------------------------------.
| BOOT | ------ | ------ | ------ | ------ | ------ | | ------ | RGBTOG | RGBMOD | RGBHUI | RGBSAI | RGBVAI |
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+------- |
| ------ |KC_LCTL |KC_LALT |KC_LGUI |KC_LSFT | ------ | | ------ |KC_MPRV |KC_VOLD |KC_VOLU |KC_MNXT | ------ |
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
| ------ |KC_ALGR | ------ | ------ | ------ | ------ | | ------ | ------ | ------ |KC_BRMD |KC_BRMU | ------ |
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
,-----------------------, ,-----------------------.
| | | | |KC_MSTP|KC_MPLY|KC_MUTE|
/|-------+-------+-------' +-------+-------+-------|\
),
*/
[_MEDIA] = LAYOUT_split_3x6_3(
QK_BOOT, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI,
_______, KC_LCTL, KC_LALT, KC_LGUI, KC_LSFT, _______, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT, _______,
_______, KC_ALGR, _______, _______, _______, _______, _______, _______, _______, KC_BRMD, KC_BRMU, _______,
_______, _______, _______, KC_MSTP, KC_MPLY, KC_MUTE
),
/*
* NAVIGATION LAYER
[_TPL] = LAYOUT_wrapper( \
//,-----------------------------------------------------. ,----------------------------------------------------.
| ------ | Save |AlfPaste| Copy | Cut | Undo | | Save |AlfPaste| Copy | Cut | Undo | ----- |
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+-------|
| ------ |KC_LCTL |KC_LALT |KC_LGUI |KC_LSFT | ------ | |KC_CAPS |KC_LEFT |KC_DOWN | KC_UP |KC_RGHT | ----- |
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+-------|
| ------ |KC_ALGR | ------ | ------ | ------ | ------ | | KC_INS |KC_HOME |KC_PGDN |KC_PGUP | KC_END | ----- |
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+-------|
,-----------------------, ,-----------------------.
| | | | | KC_ENT|KC_BSPC| KC_DEL|
/|-------+-------+-------' +-------+-------+-------|\
),
*/
[_NAV] = LAYOUT_split_3x6_3(
_______, SAVE, PASTE, COPY, CUT, UNDO, SAVE, PASTE, COPY, CUT, UNDO, _______,
_______, KC_LCTL, KC_LALT, KC_LGUI, KC_LSFT, _______, KC_CAPS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______,
_______, _______, _______, _______, _______, _______, KC_INS, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______,
_______, _______, _______, KC_ENT, KC_BSPC, KC_DEL
),
/*
* TILLING LAYER
Set to custom skhd shortcuts via yabai
[_TILNAV] = LAYOUT_wrapper( \
//,-----------------------------------------------------. ,----------------------------------------------------.
| ------ | Save |AlfPaste| Copy | Cut | Undo | | ------ | ------ | YA_BLN | YA_FUL | YA_ROT | ----- |
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+-------|
| ------ |KC_LCTL |KC_LALT |KC_LGUI |KC_LSFT | ------ | | ------ |YA_LEFT |YA_DOWN | YA_UP |YA_RGHT | ----- |
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+-------|
| ------ |KC_ALGR | ------ | ------ | ------ | ------ | | ------ | ------ | ------ | ------ | ------ | ----- |
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+-------|
,-----------------------, ,-----------------------.
| | | | | | | |
/|-------+-------+-------' +-------+-------+-------|\
),
*/
[_TILNAV] = LAYOUT_split_3x6_3(
_______, KC_NO, FCS_MV7, FCS_MV8, FCS_MV9, KC_NO, _______, _______, A(KC_F19), FUL_FLO, A(KC_F17), _______,
_______, MVW_LEF, FCS_MV4, FCS_MV5, FCS_MV6, MVW_RIG, _______, MOV_WES, MOV_SOU, MOV_NOR, MOV_EAS, _______,
_______, KC_NO, FCS_MV1, FCS_MV2, FCS_MV3, XXX, _______, _______, _______, _______, _______, _______,
_______, _______, _______, KC_LCTL, KC_LSFT, _______
),
/*
* SYMBOL LAYER
*
[_SYM] = LAYOUT_wrapper( \
//,-----------------------------------------------------. ,----------------------------------------------------.
| | PIPE | & | * | \ | [] | | | | | | | Bksp |
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+-------|
| | : | $ | % | ^ | () | | | SHIFT | CMD | ALT | CTRL | |
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+-------|
| | ~ | ! | @ | # | {} | | | | | | | |
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+-------|
,-----------------------, ,-----------------------.
| ; | - | _ | | | | |
/|-------+-------+-------' +-------+-------+-------|\
),
*/
[_SYM] = LAYOUT_split_3x6_3(
_______, KC_PIPE, KC_AMPR, KC_ASTR, KC_BSLS, SQUARES, _______, _______, _______, _______, _______, KC_BSPC,
_______, KC_COLN, KC_DLR, KC_PERC, KC_CIRC, BRACKETS, _______, KC_LSFT, KC_LGUI, KC_LALT, KC_LCTL, _______,
_______, KC_TILD, KC_EXLM, KC_AT, KC_HASH, CURLIES, _______, _______, _______, _______, _______, _______,
KC_SCLN, KC_PMNS, KC_UNDS, _______, _______, _______
),
/*
* NUMBER LAYER
[_TPL] = LAYOUT_wrapper( \
//,-----------------------------------------------------. ,----------------------------------------------------.
| | = | 7 | 8 | 9 | * | | | | | | | Bksp |
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+-------|
| | : | 4 | 5 | 6 | - | | | SHIFT | CMD | ALT | CTRL | |
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+-------|
| | / | 1 | 2 | 3 | + | | | | | | | |
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+-------|
,-----------------------, ,-----------------------.
| . | 0 | , | | | | |
/|-------+-------+-------' +-------+-------+-------|\
),
*/
[_NUM] = LAYOUT_split_3x6_3(
_______, KC_EQL, KC_7, KC_8, KC_9, KC_PAST, _______, _______, _______, _______, KC_BSPC, KC_BSPC,
_______, KC_COLN, KC_4, KC_5, KC_6, KC_PMNS, _______, KC_LSFT, KC_LGUI, KC_LALT, KC_LCTL, _______,
_______, KC_SLSH, KC_1, KC_2, KC_3, KC_PPLS, _______, _______, _______, _______, _______, _______,
KC_DOT, KC_0, KC_COMM, _______, _______, _______
),
/*
* FUN LAYER
[_TPL] = LAYOUT_wrapper( \
//,-----------------------------------------------------. ,----------------------------------------------------.
| | F12 | F7 | F8 | F9 |PRNTSCRN| | | | | | |QK_BOOT|
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+-------|
| | F11 | F4 | F5 | F6 | | | | SHIFT | CMD | ALT | CTRL | |
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+-------|
| | F10 | F1 | F2 | F3 | PAUSE | | | | | | | |
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+-------|
,-----------------------, ,-----------------------.
| ESC | SPACE | TAB | | | | |
/|-------+-------+-------' +-------+-------+-------|\
),
*/
[_FUN] = LAYOUT_split_3x6_3(
_______, KC_F12, KC_F7, KC_F8, KC_F9, KC_PSCR, _______, _______, _______, _______, _______, QK_BOOT,
_______, KC_F11, KC_F4, KC_F5, KC_F6, _______, _______, KC_LSFT, KC_LGUI, KC_LALT, KC_LCTL, _______,
_______, KC_F10, KC_F1, KC_F2, KC_F3, KC_PAUS, _______, _______, _______, _______, _______, _______,
KC_ESC, KC_SPC, KC_TAB, _______, _______, _______
)
};
#ifdef OLED_ENABLE
#include "mario.c"
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
if (!is_keyboard_master()) {
return OLED_ROTATION_180; // flips the display 180 degrees if offhand
}
return rotation;
}
void oled_render_layer_state(void) {
oled_write_P(PSTR("Layer: "), false);
switch (get_highest_layer(layer_state)) {
case _QWERTY:
oled_write_ln_P(PSTR("Default"), false);
break;
case _MEDIA:
oled_write_ln_P(PSTR("Media"), false);
break;
case _TILNAV:
oled_write_ln_P(PSTR("Tilnav"), false);
break;
case _NAV:
oled_write_ln_P(PSTR("Nav"), false);
break;
case _NUM:
oled_write_ln_P(PSTR("Num"), false);
break;
case _SYM:
oled_write_ln_P(PSTR("Sym"), false);
break;
case _FUN:
// case _ADJUST|_LOWER:
// case _ADJUST|_RAISE:
// case _ADJUST|_LOWER|_RAISE:
// case _ADJUST|_LOWER|_RAISE|_SPACE:
// case _ADJUST|_LOWER|_RAISE|_SPACE|_NUMPAD|_SODA:
oled_write_ln_P(PSTR("Fun"), false);
break;
default:
oled_write_ln_P(PSTR("?????"), false);
}
}
void render_bootmagic_status(bool status) {
/* Show Ctrl-Gui Swap options */
static const char PROGMEM logo[][2][3] = {
{{0x97, 0x98, 0}, {0xb7, 0xb8, 0}},
{{0x95, 0x96, 0}, {0xb5, 0xb6, 0}},
};
if (status) {
oled_write_ln_P(logo[0][0], false);
oled_write_ln_P(logo[0][1], false);
} else {
oled_write_ln_P(logo[1][0], false);
oled_write_ln_P(logo[1][1], false);
}
}
void oled_render_logo(void) {
static const char PROGMEM crkbd_logo[] = {
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94,
0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4,
0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4,
0};
oled_write_P(crkbd_logo, false);
}
bool oled_task_user(void) {
if (is_keyboard_master()) {
oled_render_layer_state();
} else {
oled_render_anim();
}
return false;
}
#endif // OLED_DRIVER_ENABLE
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch(keycode) {
case CURLIES:
if (record->event.pressed) {
SEND_STRING("{}");
tap_code(KC_LEFT);
}
return false;
case BRACKETS:
if (record->event.pressed) {
SEND_STRING("()");
tap_code(KC_LEFT);
}
return false;
case SQUARES:
if (record->event.pressed) {
SEND_STRING("[]");
tap_code(KC_LEFT);
}
return false;
}
return true;
}