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
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
|
/* Copyright 2021 Luis Moreno <acevice69@gmail.com>
*
* 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
#include "keymap_spanish.h"
// Insert key state definition (Insert/Overwrite Mode)
static bool ins_state = true;
// Git Commands
static const char *sendstring_commands[] = {
// Config
"config //global",
// Create
"init",
"clone",
// Local changes
"status",
"diff",
"add",
"rm",
"mv",
"commit",
"stash",
"reset",
"revert",
// Branches and Tags
"branch /b @",
"switch",
"checkout",
"tag",
// Update & Publish
"remote",
"fetch",
"pull",
"push",
// Merge & Rebase
"merge",
"rebase",
// Commit history
"logg"
};
// Layers definition
enum layers {
_QWERTY_ES,
_COLEMAK_ES,
_SYMBOL,
_FN_NUMPAD,
_NAVIGATION,
_GIT_CMDS,
_SETTINGS
};
// Encoder Modes definition
#ifdef ENCODER_ENABLE
#define ENC_ALT_MAX_TIME 1250
typedef enum {
ENC_MODE_CHAR_LINE,
ENC_MODE_WORD_PAGE,
ENC_MODE_TABBING,
ENC_MODE_VOLUME,
ENC_MODE_LAST
} encoder_mode_t;
static encoder_mode_t enc_mode;
void encoder_cycle_mode(bool up);
#endif
// Tap Dance declarations/definitions
#ifdef TAP_DANCE_ENABLE
#define ACTION_TAP_DANCE_FN_ADVANCED_USER(user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset, user_user_data) \
{ .fn = {user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset}, .user_data = (void *)user_user_data, }
#define MAX_MOD 3 // Max number of modifiers: 0-Base, 1-Shift, 2-Ctrl
typedef enum {
TD_NONE,
TD_UNKNOWN,
TD_SINGLE_TAP,
TD_SINGLE_HOLD,
TD_DOUBLE_TAP
} td_state_t;
typedef struct {
bool is_press_action;
td_state_t state;
} td_tap_t;
typedef struct {
uint16_t keycode; // Keycode:
// - Tap if keycode != KC_NO
uint8_t layer[MAX_MOD]; // Layer with modifiers (0-Base, 1-Shift, 2-Ctrl):
// - Tap if keycode == KC_NO
// - Single Hold: Activate while holding
// - Double Tap: (Un)lock Layer
} td_user_data_t;
enum td_actions {
TAB,
ESC,
SPC,
ENT,
LWR,
RAI
};
static td_tap_t td_tap_state = {
.is_press_action = true,
.state = TD_NONE
};
td_state_t td_current (tap_dance_state_t *state);
void td_kc_ly_finished(tap_dance_state_t *state, void *user_data);
void td_kc_ly_reset (tap_dance_state_t *state, void *user_data);
tap_dance_action_t tap_dance_actions[] = {
[TAB] = ACTION_TAP_DANCE_DOUBLE(KC_TAB, KC_CAPS),
[ESC] = ACTION_TAP_DANCE_FN_ADVANCED_USER(NULL, td_kc_ly_finished, td_kc_ly_reset, \
&((td_user_data_t) { KC_ESC, { _NAVIGATION, _QWERTY_ES, _QWERTY_ES }})),
[SPC] = ACTION_TAP_DANCE_FN_ADVANCED_USER(NULL, td_kc_ly_finished, td_kc_ly_reset, \
&((td_user_data_t) { KC_SPC, { _SYMBOL , _QWERTY_ES, _QWERTY_ES }})),
[ENT] = ACTION_TAP_DANCE_FN_ADVANCED_USER(NULL, td_kc_ly_finished, td_kc_ly_reset, \
&((td_user_data_t) { KC_ENT, { _SYMBOL , _QWERTY_ES, _QWERTY_ES }})),
[LWR] = ACTION_TAP_DANCE_FN_ADVANCED_USER(NULL, td_kc_ly_finished, td_kc_ly_reset, \
&((td_user_data_t) { KC_NO, { _NAVIGATION, _GIT_CMDS , _QWERTY_ES }})),
[RAI] = ACTION_TAP_DANCE_FN_ADVANCED_USER(NULL, td_kc_ly_finished, td_kc_ly_reset, \
&((td_user_data_t) { KC_NO, { _FN_NUMPAD , _GIT_CMDS , _QWERTY_ES }}))
};
#endif
// Keycode definitions
enum custom_keycodes {
CK_QUOT = SAFE_RANGE, // Single/Double quote
CK_BSDI, // Backspace/Delete/Insert
CK_ENCM, // Encoder Mode (-)
CK_ENCP, // Encoder Mode (+)
CK_LYDF, // Activate Default Layer
G_CONF, // Git Commands
G_INIT,
G_CLONE,
G_STAT,
G_DIFF,
G_ADD,
G_RM,
G_MV,
G_COMM,
G_STASH,
G_RESET,
G_REVER,
G_BRANC,
G_SWTCH,
G_CHECK,
G_TAG,
G_REMOT,
G_FETCH,
G_PULL,
G_PUSH,
G_MERGE,
G_REBAS,
G_LOG
};
#define LY_QWES DF(_QWERTY_ES)
#define LY_CLES DF(_COLEMAK_ES)
#ifdef TAP_DANCE_ENABLE
#define TD_TBCP TD(TAB)
#define TD_ESSY TD(ESC)
#define TD_SPSY TD(SPC)
#define TD_ENSY TD(ENT)
#define TD_LOWR TD(LWR)
#define TD_RAIS TD(RAI)
#else
#define TD_TBCP MT(MOD_LSFT, KC_TAB)
#define TD_ESSY LT(_SYMBOL , KC_ESC)
#define TD_SPSY KC_SPC
#define TD_ENSY KC_ENT
#define TD_LOWR TT(_NAVIGATION)
#define TD_RAIS TT(_SYMBOL)
#endif
#define MO_LSFT OSM(MOD_LSFT)
#define MO_LCTL OSM(MOD_LCTL)
#define MO_LALT OSM(MOD_LALT)
#define MT_RGUI MT(MOD_RGUI, KC_LEFT)
#define MT_RALT MT(MOD_RALT, KC_DOWN)
#define MT_RCTL MT(MOD_RCTL, KC_UP)
#define MT_RSFT MT(MOD_RSFT, KC_RGHT)
// Keymap definitions
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// clang-format off
/*
* Basic characters (QWERTY ES)
*
* ,-------------------------------------------. ,-------------------------------------------.
* |Esc/LNav| Q | W | E | R | T | | Y | U | I | O | P |BS/Dl/In|
* |--------+------+------+------+------+------| |------+------+------+------+------+--------|
* |Tab/Caps| A | S | D | F | G | | H | J | K | L | Ñ | ´ ¨ |
* |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
* |EncMode-| Z | X | C | V | B | LGit | | | | LGit | N | M | , ; | . : | - _ |EncMode+|
* `-------------------------------------------| LNav | Space| | Enter|LFnNum|-------------------------------------------'
* +--------------------+------+ / | | / +------+--------------------+
* | Shift| Ctrl | Alt | GUI | LSym | | LSym | GUI | AltGr| Ctrl | Shift|
* | | | | | | | | <- | v | ^ | -> |
* `----------------------------------' `----------------------------------'
*/
[_QWERTY_ES] = LAYOUT(
TD_ESSY, ES_Q, ES_W, ES_E, ES_R, ES_T, ES_Y, ES_U, ES_I, ES_O, ES_P, CK_BSDI,
TD_TBCP, ES_A, ES_S, ES_D, ES_F, ES_G, ES_H, ES_J, ES_K, ES_L, ES_NTIL, ES_ACUT,
CK_ENCM, ES_Z, ES_X, ES_C, ES_V, ES_B, TD_LOWR, XXXXXXX, XXXXXXX, TD_RAIS, ES_N, ES_M, ES_COMM, ES_DOT, ES_MINS, CK_ENCP,
MO_LSFT, MO_LCTL, MO_LALT, KC_LGUI, TD_SPSY, TD_ENSY, MT_RGUI, MT_RALT, MT_RCTL, MT_RSFT
),
/*
* Basic characters (COLEMAK ES)
*
* ,-------------------------------------------. ,-------------------------------------------.
* |Esc/LNav| Q | W | F | P | G | | J | L | U | Y | Ñ |BS/Dl/In|
* |--------+------+------+------+------+------| |------+------+------+------+------+--------|
* |Tab/Caps| A | R | S | T | D | | H | N | E | I | O | ´ ¨ |
* |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
* |EncMode-| Z | X | C | V | B | LGit | | | | LGit | K | M | , ; | . : | - _ |EncMode+|
* `-------------------------------------------| LNav | Space| | Enter|LFnNum|-------------------------------------------'
* +--------------------+------+ / | | / +------+--------------------+
* | Shift| Ctrl | Alt | GUI | LSym | | LSym | GUI | AltGr| Ctrl | Shift|
* | | | | | | | | <- | v | ^ | -> |
* `----------------------------------' `----------------------------------'
*/
[_COLEMAK_ES] = LAYOUT(
TD_ESSY, ES_Q, ES_W, ES_F, ES_P, ES_G, ES_J, ES_L, ES_U, ES_Y, ES_NTIL, CK_BSDI,
TD_TBCP, ES_A, ES_R, ES_S, ES_T, ES_D, ES_H, ES_N, ES_E, ES_I, ES_O, ES_ACUT,
CK_ENCM, ES_Z, ES_X, ES_C, ES_V, ES_B, TD_LOWR, XXXXXXX, XXXXXXX, TD_RAIS, ES_K, ES_M, ES_COMM, ES_DOT, ES_MINS, CK_ENCP,
MO_LSFT, MO_LCTL, MO_LALT, KC_LGUI, TD_SPSY, TD_ENSY, MT_RGUI, MT_RALT, MT_RCTL, MT_RSFT
),
/*
* Symbols
*
* ,-------------------------------------------. ,-------------------------------------------.
* | | 1 ! | 2 " | 3 · | 4 $ | 5 % | | 6 & | 7 / | 8 ( | 9 ) | 0 = | |
* |--------+------+------+------+------+------| |------+------+------+------+------+--------|
* | | ¡ ¿ | ' " | º ª | \ | | ¡ | | ~ $ | + * | - _ | / | ' ? | ` ^ |
* |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
* | | @ ⅛ | { | ( | [ ° | < > | | | | | | > | ] ¯ | ) | } ˘ | # £ | |
* `----------------------+------+------+------+------+ | | +------+------+------+------+----------------------'
* | | | | | | | | | | | |
* | | | | | | | | | | | |
* `----------------------------------' `----------------------------------'
*/
[_SYMBOL] = LAYOUT(
_______, ES_1, ES_2, ES_3, ES_4, ES_5, ES_6, ES_7, ES_8, ES_9, ES_0, _______,
_______, ES_IEXL, CK_QUOT, ES_MORD, ES_BSLS, ES_PIPE, ES_TILD, ES_PLUS, ES_MINS, ES_SLSH, ES_QUOT, ES_GRV,
_______, ES_AT, ES_LCBR, ES_LPRN, ES_LBRC, ES_LABK, _______, XXXXXXX, XXXXXXX, _______, ES_RABK, ES_RBRC, ES_RPRN, ES_RCBR, ES_HASH, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______
),
/*
* Function keys, NumPad keys
*
* ,-------------------------------------------. ,-------------------------------------------.
* | | F1 | F2 | F3 | F4 | | | , ; | 7 / | 8 ( | 9 ) | * | |
* |--------+------+------+------+------+------| |------+------+------+------+------+--------|
* | | F5 | F6 | F7 | F8 | | | . : | 4 $ | 5 % | 6 & | - _ | + * |
* |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
* | | F9 | F10 | F11 | F12 | | | | | | | 0 = | 1 ! | 2 " | 3 · | / | |
* `----------------------+------+------+------+------+ | | +------+------+------+------+----------------------'
* | | | | | | | | | | | |
* | | | | | | | | | | | |
* `----------------------------------' `----------------------------------'
*/
[_FN_NUMPAD] = LAYOUT(
_______, KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, ES_COMM, ES_7, ES_8, ES_9, ES_ASTR, _______,
_______, KC_F5, KC_F6, KC_F7, KC_F8, XXXXXXX, ES_DOT, ES_4, ES_5, ES_6, ES_MINS, ES_PLUS,
_______, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, _______, XXXXXXX, XXXXXXX, _______, ES_0, ES_1, ES_2, ES_3, ES_SLSH, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______
),
/*
* Navigation (Mouse deactivated for space saving)
*
* ,-------------------------------------------. ,-------------------------------------------.
* | | | MBt1 | MUp | MBt2 | | | PgUp | Home | Up | End | PgUp | |
* |--------+------+------+------+------+------| |------+------+------+------+------+--------|
* | | Menu | MLeft| MDown|MRight| | | PgDn | Left | Down | Right| PgDn | |
* |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
* | | | | | | | | | | | | |PrtScr|ScrLck| Pause| | |
* `----------------------+------+------+------+------+ | | +------+------+------+------+----------------------'
* | | | | | | | | | | | |
* | | | | | | | | | | | |
* `----------------------------------' `----------------------------------'
*/
[_NAVIGATION] = LAYOUT(
_______, XXXXXXX, KC_BTN1, KC_MS_U, KC_BTN2, XXXXXXX, KC_PGUP, KC_HOME, KC_UP, KC_END, KC_PGUP, _______,
_______, KC_APP, KC_MS_L, KC_MS_D, KC_MS_R, XXXXXXX, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______,
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, KC_PSCR, KC_SCRL, KC_PAUS, XXXXXXX, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______
),
/*
* Git Commands
*
* ,-------------------------------------------. ,-------------------------------------------.
* | |Config| | | Init | | | | Clone| | | | |
* |--------+------+------+------+------+------| |------+------+------+------+------+--------|
* | | Diff | Add | Rm | Mv | | |Remote| Fetch| Pull | Push | Merge| Rebase |
* |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
* | |Commit| Stash| Reset|Revert|Status| | | | | | Log |Branch|Switch|ChkOut| Tag | |
* `----------------------+------+------+------+------+ | | +------+------+------+------+----------------------'
* | | | | | | | | | | | |
* | | | | | | | | | | | |
* `----------------------------------' `----------------------------------'
*/
[_GIT_CMDS] = LAYOUT(
_______, G_CONF, XXXXXXX, XXXXXXX, G_INIT, XXXXXXX, XXXXXXX, G_CLONE, XXXXXXX, XXXXXXX, XXXXXXX, _______,
_______, G_DIFF, G_ADD, G_RM, G_MV, XXXXXXX, G_REMOT, G_FETCH, G_PULL, G_PUSH, G_MERGE, G_REBAS,
_______, G_COMM, G_STASH, G_RESET, G_REVER, G_STAT, _______, XXXXXXX, XXXXXXX, _______, G_LOG, G_BRANC, G_SWTCH, G_CHECK, G_TAG, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______
),
/*
* Settings (Default Layer, RGB, Media)
*
* ,-------------------------------------------. ,-------------------------------------------.
* | |QWE_ES|CLM_ES| | | | | | | Vol+ | | | |
* |--------+------+------+------+------+------| |------+------+------+------+------+--------|
* | | TOG | HUE+ | SAT+ | VAL+ | MOD | | Mute | Prev | Play | Next | | |
* |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
* | LDef | | HUE- | SAT- | VAL- | RMOD | | | | | | | | Vol- | | | LDef |
* `----------------------+------+------+------+------+ | | +------+------+------+------+----------------------'
* | | | | | | | | | | | |
* | | | | | | | | | | | |
* `----------------------------------' `----------------------------------'
*/
[_SETTINGS] = LAYOUT(
_______, LY_QWES, LY_CLES, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_VOLU, XXXXXXX, XXXXXXX, _______,
_______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, RGB_MOD, KC_MUTE, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, XXXXXXX,
CK_LYDF, XXXXXXX, RGB_HUD, RGB_SAD, RGB_VAD, RGB_RMOD,_______, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, KC_VOLD, XXXXXXX, XXXXXXX, CK_LYDF,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______
),
// /*
// * Layer template
// *
// * ,-------------------------------------------. ,-------------------------------------------.
// * | | | | | | | | | | | | | |
// * |--------+------+------+------+------+------| |------+------+------+------+------+--------|
// * | | | | | | | | | | | | | |
// * |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
// * | | | | | | | | | | | | | | | | | |
// * `----------------------+------+------+------+------+ | | +------+------+------+------+----------------------'
// * | | | | | | | | | | | |
// * | | | | | | | | | | | |
// * `----------------------------------' `----------------------------------'
// */
// [_LAYERINDEX] = LAYOUT(
// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
// _______, _______, _______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______, _______, _______,
// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
// ),
};
// clang-format on
/*
* INITIALIZING FUNCTIONS
*/
void matrix_init_user(void) {
#ifdef ENCODER_ENABLE
enc_mode = ENC_MODE_CHAR_LINE;
#endif
}
/*
* LAYER FUNCTIONS
*/
layer_state_t layer_state_set_user(layer_state_t state) {
// Activate Settings layer when both Symbol and Navigation layers are on
return update_tri_layer_state(state, _SYMBOL, _NAVIGATION, _SETTINGS);
}
/*
* MACRO FUNCTIONS
*/
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
// Get current modifier status (Normal and One Shot)
uint8_t mod_state = get_mods();
uint8_t osm_state = get_oneshot_mods();
// Process keycode
switch (keycode) {
case CK_QUOT: // Single/Double Quote
if (record->event.pressed) {
if ((mod_state | osm_state) & MOD_MASK_SHIFT) {
register_code(ES_2); // Shift(2) -> "
} else {
register_code(ES_QUOT); // Single Quote -> '
}
} else {
if ((mod_state | osm_state) & MOD_MASK_SHIFT) {
unregister_code(ES_2); // Shift(2) -> "
} else {
unregister_code(ES_QUOT); // Single Quote -> '
}
}
return false;
break;
case CK_BSDI: { // Backspace/Delete/Insert
static bool delkey_registered = false;
if (record->event.pressed) {
// Ctrl -> Insert/Overwrite Mode
// Shift -> Delete
// Normal -> Backspace
if ((mod_state | osm_state) & MOD_MASK_CTRL) {
del_mods(MOD_MASK_CTRL);
del_oneshot_mods(MOD_MASK_CTRL);
tap_code(KC_INS);
set_mods(mod_state);
set_oneshot_mods(osm_state);
ins_state = !ins_state;
} else if ((mod_state | osm_state) & MOD_MASK_SHIFT) {
delkey_registered = true;
del_mods(MOD_MASK_SHIFT);
del_oneshot_mods(MOD_MASK_SHIFT);
register_code(KC_DEL);
set_mods(mod_state);
set_oneshot_mods(osm_state);
} else {
register_code(KC_BSPC);
}
} else {
// Unregister keycode sent after the release of CK_BSDI
if (delkey_registered) {
unregister_code(KC_DEL);
delkey_registered = false;
} else {
unregister_code(KC_BSPC);
}
}
return false;
}
break;
case CK_LYDF: // De-activate all layers and activate Default layer
layer_move(get_highest_layer(default_layer_state));
return false;
break;
case G_CONF ... G_LOG:
if (record->event.pressed) {
del_mods(MOD_MASK_SHIFT);
del_oneshot_mods(MOD_MASK_SHIFT);
SEND_STRING("git ");
send_string(sendstring_commands[keycode - G_CONF]);
set_mods(mod_state);
set_oneshot_mods(osm_state);
}
break;
#ifdef ENCODER_ENABLE
case CK_ENCM: // Encoder Mode (-)
if (record->event.pressed) {
encoder_cycle_mode(false);
}
break;
case CK_ENCP: // Encoder Mode (+)
if (record->event.pressed) {
encoder_cycle_mode(true);
}
break;
#endif
}
return true;
};
/*
* TAP DANCE FUNCTIONS
*/
#ifdef TAP_DANCE_ENABLE
td_state_t td_current(tap_dance_state_t *state) {
switch (state->count) {
case 1:
return ((!state->pressed) ? TD_SINGLE_TAP : TD_SINGLE_HOLD);
case 2:
return TD_DOUBLE_TAP;
default:
return TD_UNKNOWN;
}
}
void td_kc_ly_finished(tap_dance_state_t *state, void *user_data) {
td_tap_state.state = td_current(state);
uint16_t keycode = ((td_user_data_t *)user_data)->keycode;
uint8_t *layer_arr = ((td_user_data_t *)user_data)->layer;
uint8_t layer_sel = *(layer_arr + 0);
// Get current modifier status (Normal and One Shot) and select layer
uint8_t mod_state = get_mods();
uint8_t osm_state = get_oneshot_mods();
if ((mod_state | osm_state) & MOD_MASK_SHIFT) {
if (*(layer_arr + 1) > _QWERTY_ES) {
layer_sel = *(layer_arr + 1);
}
}
if ((mod_state | osm_state) & MOD_MASK_CTRL) {
if (*(layer_arr + 2) > _QWERTY_ES) {
layer_sel = *(layer_arr + 2);
}
}
switch (td_tap_state.state) {
case TD_NONE:
case TD_UNKNOWN:
break;
case TD_SINGLE_TAP:
// Send keycode if available
// Otherwise, Lock Layer (Base/Shift/Ctrl) and Unlock rest of selectable layers
if (keycode != KC_NO) {
tap_code(keycode);
} else {
uint8_t layer_aux;
for (layer_aux = _GIT_CMDS; layer_aux >= _SYMBOL; layer_aux--) {
if ((layer_aux == layer_sel) && (!layer_state_is(layer_aux))) {
layer_on(layer_aux);
} else {
layer_off(layer_aux);
}
}
}
break;
case TD_SINGLE_HOLD:
// Lock Layer (Base/Shift/Ctrl) while Single Hold on the way
layer_on(layer_sel);
break;
case TD_DOUBLE_TAP:
// (Un)lock Layer (Base/Shift/Ctrl)
if (layer_state_is(layer_sel)) {
layer_off(layer_sel);
} else {
layer_on(layer_sel);
}
break;
}
}
void td_kc_ly_reset(tap_dance_state_t *state, void *user_data) {
uint8_t *layer_arr = ((td_user_data_t *)user_data)->layer;
if (td_tap_state.state == TD_SINGLE_HOLD) {
// Unlock any Layer (Base/Shift/Ctrl) when Single Hold finalizes
uint8_t i;
uint8_t layer_aux;
for (i = 0; i < MAX_MOD; i++) {
layer_aux = *(layer_arr + i);
if ((layer_aux > _QWERTY_ES)) {
layer_off(layer_aux);
}
}
}
td_tap_state.state = TD_NONE;
}
#endif
/*
* OLED FUNCTIONS
*/
#ifdef OLED_DRIVER_ENABLE
static void render_kyria_logo(void) {
static const char PROGMEM kyria_logo[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0xe0, 0xf0, 0x78, 0x38, 0x1c, 0x1e, 0x0e,
0x8e, 0x86, 0x86, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x86,
0x86, 0x8e, 0x0e, 0x1e, 0x1c, 0x38, 0x78, 0xf0, 0xe0, 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xe0, 0xf0, 0xfc, 0x3e, 0x0f, 0x07, 0x83, 0xe1, 0xf0, 0xf8, 0xbc, 0x9e, 0x8f, 0x87,
0x87, 0x83, 0x81, 0x81, 0xe0, 0x78, 0x1f, 0x07, 0xff, 0xff, 0x07, 0x1f, 0x78, 0xe0, 0x81, 0x81,
0x83, 0x87, 0x87, 0x8f, 0x9e, 0xbc, 0xf8, 0xf0, 0xe1, 0x83, 0x07, 0x0f, 0x3e, 0xfc, 0xf0, 0xe0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xfc, 0xff, 0x03, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x07, 0x07, 0x3f, 0x73, 0xc7, 0x8f, 0x8d,
0x89, 0x99, 0x99, 0xb1, 0xf7, 0xee, 0xf8, 0xf0, 0xff, 0xff, 0xf0, 0xf8, 0xee, 0xf7, 0xb1, 0x99,
0x99, 0x89, 0x8d, 0x8f, 0xc7, 0x73, 0x3f, 0x07, 0x07, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x03, 0xff,
0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x3f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xe0, 0xe0, 0xfc, 0xce, 0xe3, 0xf1, 0xb1,
0x91, 0x99, 0x99, 0x8d, 0xef, 0x77, 0x1f, 0x0f, 0xff, 0xff, 0x0f, 0x1f, 0x77, 0xef, 0x8d, 0x99,
0x99, 0x91, 0xb1, 0xf1, 0xe3, 0xce, 0xfc, 0xe0, 0xe0, 0xff, 0x3f, 0x00, 0x00, 0x00, 0xc0, 0xff,
0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x07, 0x0f, 0x3f, 0x7c, 0xf0, 0xe0, 0xc1, 0x87, 0x0f, 0x1f, 0x3d, 0x79, 0xf1, 0xe1,
0xe1, 0xc1, 0x81, 0x81, 0x07, 0x1e, 0xf8, 0xe0, 0xff, 0xff, 0xe0, 0xf8, 0x1e, 0x07, 0x81, 0x81,
0xc1, 0xe1, 0xe1, 0xf1, 0x79, 0x3d, 0x1f, 0x0f, 0x87, 0xc1, 0xe0, 0xf0, 0x7c, 0x3f, 0x0f, 0x07,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x07, 0x07, 0x0f, 0x1e, 0x1c, 0x38, 0x78, 0x70,
0x71, 0x61, 0x61, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x61,
0x61, 0x71, 0x70, 0x78, 0x38, 0x1c, 0x1e, 0x0f, 0x07, 0x07, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xc0, 0xfe, 0xfe, 0xfe, 0xc6, 0xe0, 0xf0, 0x70, 0x30, 0x10, 0x00, 0x70,
0xf0, 0xf0, 0x80, 0x00, 0xc0, 0xf0, 0xf0, 0x70, 0x10, 0xc0, 0xf0, 0xf0, 0xf0, 0x70, 0x30, 0x30,
0x30, 0xc0, 0xf6, 0xf6, 0xf6, 0x06, 0x00, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xf0, 0xf0, 0xe0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x10, 0x1f, 0x1f, 0x1f, 0x03, 0x0f, 0x1f, 0x1e, 0x18, 0x10, 0x00, 0xc0, 0xc0,
0xe7, 0xff, 0x7f, 0x3f, 0x0f, 0x03, 0x01, 0x00, 0x18, 0x1f, 0x1f, 0x1f, 0x00, 0x00, 0x00, 0x00,
0x18, 0x1f, 0x1f, 0x1f, 0x00, 0x0e, 0x1f, 0x1f, 0x1f, 0x19, 0x0d, 0x1f, 0x1f, 0x1f, 0x03, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
oled_write_raw_P(kyria_logo, sizeof(kyria_logo));
}
static void render_qmk_logo(void) {
static const char PROGMEM qmk_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(qmk_logo, false);
}
static void render_status(void) {
// Get current modifier status (Normal and One Shot)
uint8_t mod_state = get_mods();
uint8_t osm_state = get_oneshot_mods();
uint8_t osl_state = get_oneshot_locked_mods();
bool caps_lock = host_keyboard_led_state().caps_lock;
// QMK Logo
render_qmk_logo();
#ifdef ENCODER_ENABLE
// Host Keyboard Encoder Mode
switch (enc_mode) {
case ENC_MODE_CHAR_LINE:
oled_write_P(PSTR("ENC \020 CHAR/LINE\n"), false);
break;
case ENC_MODE_WORD_PAGE:
oled_write_P(PSTR("ENC \020 WORD/PAGE\n"), false);
break;
case ENC_MODE_TABBING:
oled_write_P(PSTR("ENC \020 TABBING\n"), false);
break;
case ENC_MODE_VOLUME:
case ENC_MODE_LAST:
oled_write_P(PSTR("ENC \020 VOLUME\n"), false);
break;
}
#else
oled_write_P(PSTR("\n"), false);
#endif
// Host Keyboard Layer Status
oled_write_P(PSTR("\n"), false);
switch (get_highest_layer(layer_state)) {
case _QWERTY_ES:
oled_write_P(PSTR("L00 \020 QWERTY (ES)\n"), false);
break;
case _COLEMAK_ES:
oled_write_P(PSTR("L00 \020 COLEMAK (ES)\n"), false);
break;
case _SYMBOL:
oled_write_P(PSTR("L01 \020 SYMBOLS\n"), false);
break;
case _FN_NUMPAD:
oled_write_P(PSTR("L02 \020 FN / NUMPAD\n"), false);
break;
case _NAVIGATION:
oled_write_P(PSTR("L03 \020 NAVIGATION\n"), false);
break;
case _GIT_CMDS:
oled_write_P(PSTR("L04 \020 GIT COMMANDS\n"), false);
break;
case _SETTINGS:
oled_write_P(PSTR("L05 \020 SETTINGS\n"), false);
break;
}
// Host Keyboard Locked Modifiers Status
oled_write_P((osl_state & MOD_MASK_SHIFT) ? PSTR("LCK ") : PSTR(" ") , false);
oled_write_P((osl_state & MOD_MASK_CTRL) ? PSTR("LCK ") : PSTR(" ") , false);
oled_write_P((osl_state & MOD_MASK_ALT) ? PSTR("LCK ") : PSTR(" ") , false);
oled_write_P( PSTR(" ") , false);
oled_write_P((caps_lock) ? PSTR(" CAPS") : PSTR(" "), false);
// Host Keyboard Modifiers Status
oled_write_P(((mod_state | osm_state) & MOD_MASK_SHIFT) ? PSTR("SHF ") : PSTR(" ") , false);
oled_write_P(((mod_state | osm_state) & MOD_MASK_CTRL) ? PSTR("CTR ") : PSTR(" ") , false);
oled_write_P(((mod_state | osm_state) & MOD_MASK_ALT) ? PSTR("ALT ") : PSTR(" ") , false);
oled_write_P(((mod_state | osm_state) & MOD_MASK_GUI) ? PSTR("GUI ") : PSTR(" ") , false);
oled_write_P((ins_state) ? PSTR(" INS") : PSTR(" OWR"), false);
}
static void render_settings(void) {
#ifdef RGBLIGHT_ENABLE
char rgb_str[4];
oled_write_P(PSTR("\n\n"), false);
oled_write_P(PSTR("\020H: "), false);
itoa(rgblight_get_hue(), rgb_str, 10);
oled_write_ln(rgb_str, false);
oled_write_P(PSTR("\020S: "), false);
itoa(rgblight_get_sat(), rgb_str, 10);
oled_write_ln(rgb_str, false);
oled_write_P(PSTR("\020V: "), false);
itoa(rgblight_get_val(), rgb_str, 10);
oled_write_ln(rgb_str, false);
#else
oled_write_P(PSTR("\n\n\n\n\n"), false);
#endif
switch (get_highest_layer(default_layer_state)) {
case _QWERTY_ES:
oled_write_ln_P(PSTR(" \020QWERTY (ES)") , false);
break;
case _COLEMAK_ES:
oled_write_P (PSTR(" \020COLEMAK (ES)"), false);
break;
}
#ifdef RGBLIGHT_ENABLE
oled_write_ln_P(PSTR(" RGB DEFAULT"), false);
oled_write_ln_P(PSTR("SETTINGS LAYER "), false);
#else
oled_write_ln_P(PSTR(" DEFAULT"), false);
oled_write_ln_P(PSTR(" LAYER "), false);
#endif
}
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
return OLED_ROTATION_180;
}
void oled_task_user(void) {
if (is_keyboard_master()) { // Main screen: Renders keyboard state (layer, modifiers) / RGB settings
if (get_highest_layer(layer_state) != _SETTINGS) {
render_status();
} else {
render_settings();
}
} else { // Auxiliar screen: Renders Kyria logo with scroll
render_kyria_logo();
oled_scroll_right();
}
}
#endif
/*
* ENCODER FUNCTIONS
*/
#ifdef ENCODER_ENABLE
void encoder_cycle_mode(bool up) {
if (enc_mode == 0 && !up) {
enc_mode = ENC_MODE_LAST - 1;
} else {
enc_mode = (enc_mode + (up ? +1 : -1)) % ENC_MODE_LAST;
}
}
bool encoder_update_user(uint8_t index, bool clockwise) {
// Select encoder mode
switch (enc_mode) {
case ENC_MODE_CHAR_LINE:
// Left Encoder: Character Left/Right. Right Encoder: Line Up/Down.
tap_code(!clockwise ? (index == 0 ? KC_LEFT : KC_UP): (index == 0 ? KC_RGHT : KC_DOWN));
break;
case ENC_MODE_WORD_PAGE:
// Left Encoder: Word Left/Right. Right Encoder: Page Up/Down.
tap_code16(!clockwise ? (index == 0 ? C(KC_LEFT) : KC_PGUP): (index == 0 ? C(KC_RGHT) : KC_PGDN));
break;
case ENC_MODE_TABBING:
// Left Encoder: Navigation Tabbing. Right Encoder: Editor Tabbing.
tap_code16(!clockwise ? (index == 0 ? S(C(KC_TAB)) : C(KC_PGUP)): (index == 0 ? C(KC_TAB) : C(KC_PGDN)));
break;
case ENC_MODE_VOLUME:
case ENC_MODE_LAST:
// Volume control
tap_code(clockwise ? KC_VOLU : KC_VOLD);
break;
}
return true;
}
#endif
|