forked from sunaku/glove80-keymaps
-
Notifications
You must be signed in to change notification settings - Fork 1
/
keymap.dtsi
2676 lines (2418 loc) · 109 KB
/
keymap.dtsi
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
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//////////////////////////////////////////////////////////////////////
// NOTE: Use the `#define` settings below to customize this keymap! //
// You can override them here instead of modifying them down there. //
// /* EXAMPLE: */ #define EMOJI_HAIR_STYLE_PRESET 3 // curly_hair //
//////////////////////////////////////////////////////////////////////
//
// Sunaku's Keymap v31 -- "Glorious Engrammer"
// - https://github.com/sunaku/glove80-keymaps
//
//////////////////////////////////////////////////////////////////////
behaviors {
//////////////////////////////////////////////////////////////////////////
//
// Miryoku layers and home row mods (ported from my QMK endgame)
// - https://sunaku.github.io/home-row-mods.html#porting-to-zmk
// - https://github.com/urob/zmk-config#timeless-homerow-mods
//
//////////////////////////////////////////////////////////////////////////
//
// HOMEY_HOLDING_TYPE defines the flavor of ZMK hold-tap behavior to use
// for the pinky, ring, and middle fingers (which are assigned to Super,
// Alt, and Ctrl respectively in the Miryoku system) on home row keys.
//
#ifndef HOMEY_HOLDING_TYPE
#define HOMEY_HOLDING_TYPE "tap-preferred"
#endif
//
// HOMEY_HOLDING_TIME defines how long you need to hold (milliseconds)
// home row mod keys in order to send their modifiers to the computer
// (i.e. "register" them) for mod-click mouse usage (e.g. Ctrl-Click).
//
#ifndef HOMEY_HOLDING_TIME
#define HOMEY_HOLDING_TIME 270 // TAPPING_TERM + ALLOW_CROSSOVER_AFTER
#endif
//
// HOMEY_STREAK_DECAY defines how long you need to wait (milliseconds)
// after typing before you can use home row mods again. It prevents
// unintended activation of home row mods when you're actively typing.
//
#ifndef HOMEY_STREAK_DECAY
#define HOMEY_STREAK_DECAY 170 // global-quick-tap-ms
#endif
//
// HOMEY_REPEAT_DECAY defines how much time you have left (milliseconds)
// after tapping a key to hold it again in order to make it auto-repeat.
//
#ifndef HOMEY_REPEAT_DECAY
#define HOMEY_REPEAT_DECAY 300 // "tap then hold" for key auto-repeat
#endif
//
// SHIFT_HOLDING_TYPE defines the flavor of ZMK hold-tap behavior to use
// for index fingers (which Miryoku assigns to Shift) on home row keys.
//
// NOTE: The "tap-preferred" flavor of ZMK hold-tap for index finger keys
// allows faster activation of the Shift modifier (without having to wait
// for the modified key to be released as the "balanced" flavor requires).
// Typing streaks and the `hold-trigger-on-release` setting are disabled
// for the index fingers so as not to hinder their speed and dexterity.
//
#ifndef SHIFT_HOLDING_TYPE
#define SHIFT_HOLDING_TYPE "tap-preferred"
#endif
//
// SHIFT_HOLDING_TIME defines how long you need to hold (milliseconds)
// index finger keys in order to send their modifiers to the computer
// (i.e. "register" them) for mod-click mouse usage (e.g. Shift-Click).
//
// CAUTION: You'll need to perform inward rolls from pinky->ring->middle
// fingers toward the index fingers when activating multiple modifiers
// because `hold-trigger-on-release` is disabled for the index fingers.
// Otherwise, you may be surprised that the index fingers' modifier is
// sent immediately without the rest of your multi-mod chord when you
// perform outward rolls from your index fingers toward your pinkies.
//
#ifndef SHIFT_HOLDING_TIME
#define SHIFT_HOLDING_TIME 170
#endif
//
// SHIFT_STREAK_DECAY defines how long you need to wait (milliseconds)
// after typing before you can use home row mods again. It prevents
// unintended activation of home row mods when you're actively typing.
//
#ifndef SHIFT_STREAK_DECAY
#define SHIFT_STREAK_DECAY 70 // global-quick-tap-ms
#endif
//
// SHIFT_REPEAT_DECAY defines how much time you have left (milliseconds)
// after tapping a key to hold it again in order to make it auto-repeat.
//
#ifndef SHIFT_REPEAT_DECAY
#define SHIFT_REPEAT_DECAY 300 // "tap then hold" for key auto-repeat
#endif
//
// THUMB_HOLDING_TYPE defines the flavor of ZMK hold-tap behavior to use
// for the thumbs (which are assigned to 6 layers in the Miryoku system).
//
// NOTE: The "balanced" flavor of ZMK hold-tap provides instant modifier
// activation for the symbol layer (if the tapped symbol key is released
// while the thumb layer key is still held down) for quicker programming.
//
#ifndef THUMB_HOLDING_TYPE
#define THUMB_HOLDING_TYPE "balanced"
#endif
//
// THUMB_HOLDING_TIME defines how long you need to hold (milliseconds)
// a thumb key to activate a layer. Shorter holds are treated as taps.
//
#ifndef THUMB_HOLDING_TIME
#define THUMB_HOLDING_TIME 200
#endif
//
// THUMB_REPEAT_DECAY defines how much time you have left (milliseconds)
// after tapping a key to hold it again in order to make it auto-repeat.
//
#ifndef THUMB_REPEAT_DECAY
#define THUMB_REPEAT_DECAY 300 // "tap then hold" for key auto-repeat
#endif
//
// SPACE_HOLDING_TIME defines how long you need to hold (milliseconds)
// the space thumb key to activate. Shorter holds are treated as taps.
//
#ifndef SPACE_HOLDING_TIME
#define SPACE_HOLDING_TIME 170
#endif
//
// SPACE_REPEAT_DECAY defines how much time you have left (milliseconds)
// after tapping a key to hold it again in order to make it auto-repeat.
//
#ifndef SPACE_REPEAT_DECAY
#define SPACE_REPEAT_DECAY 200 // "tap then hold" for key auto-repeat
#endif
//
// Glove80 key positions index for positional hold-tap
// - https://discord.com/channels/877392805654306816/937645688244826154/1066713913351221248
// - https://media.discordapp.net/attachments/937645688244826154/1066713913133121556/image.png
//
// |------------------------|------------------------|
// | LEFT_HAND_KEYS | RIGHT_HAND_KEYS |
// | | |
// | 0 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 | 58 59 60 61 62 63 |
// | 64 65 66 67 68 | 75 76 77 78 79 |
// | 69 52 | 57 74 |
// | 70 53 | 56 73 |
// | 71 54 | 55 72 |
// |------------------------|------------------------|
//
#define LEFT_HAND_KEYS \
0 1 2 3 4 \
10 11 12 13 14 15 \
22 23 24 25 26 27 \
34 35 36 37 38 39 \
46 47 48 49 50 51 \
64 65 66 67 68
#define RIGHT_HAND_KEYS \
5 6 7 8 9 \
16 17 18 19 20 21 \
28 29 30 31 32 33 \
40 41 42 43 44 45 \
58 59 60 61 62 63 \
75 76 77 78 79
#define THUMB_KEYS \
69 52 57 74 \
70 53 56 73 \
71 54 55 72
//
// Home row mod-tap keys for all except index fingers
//
homey_left: miryoku_home_row_mods_left_hand {
compatible = "zmk,behavior-hold-tap";
label = "HOME_ROW_MODS_LEFT_HAND";
flavor = HOMEY_HOLDING_TYPE;
hold-trigger-key-positions = <RIGHT_HAND_KEYS THUMB_KEYS>;
hold-trigger-on-release; // wait for other home row mods
tapping-term-ms = <HOMEY_HOLDING_TIME>;
quick-tap-ms = <HOMEY_REPEAT_DECAY>;
require-prior-idle-ms = <HOMEY_STREAK_DECAY>;
#binding-cells = <2>;
bindings = <&kp>, <&kp>;
};
homey_right: miryoku_home_row_mods_right_hand {
compatible = "zmk,behavior-hold-tap";
label = "HOME_ROW_MODS_RIGHT_HAND";
flavor = HOMEY_HOLDING_TYPE;
hold-trigger-key-positions = <LEFT_HAND_KEYS THUMB_KEYS>;
hold-trigger-on-release; // wait for other home row mods
tapping-term-ms = <HOMEY_HOLDING_TIME>;
quick-tap-ms = <HOMEY_REPEAT_DECAY>;
require-prior-idle-ms = <HOMEY_STREAK_DECAY>;
#binding-cells = <2>;
bindings = <&kp>, <&kp>;
};
//
// Special home row mod-tap keys for the index fingers
//
shift_left: miryoku_home_row_mods_left_shift_shift {
compatible = "zmk,behavior-hold-tap";
label = "HOME_ROW_MODS_LEFT_SHIFT_SHIFT";
flavor = SHIFT_HOLDING_TYPE;
hold-trigger-key-positions = <RIGHT_HAND_KEYS THUMB_KEYS>;
//hold-trigger-on-release; // don't wait for other mods
tapping-term-ms = <SHIFT_HOLDING_TIME>;
quick-tap-ms = <SHIFT_REPEAT_DECAY>;
require-prior-idle-ms = <SHIFT_STREAK_DECAY>;
#binding-cells = <2>;
bindings = <&kp>, <&kp>;
};
shift_right: miryoku_home_row_mods_right_shift_shift {
compatible = "zmk,behavior-hold-tap";
label = "HOME_ROW_MODS_RIGHT_SHIFT_SHIFT";
flavor = SHIFT_HOLDING_TYPE;
hold-trigger-key-positions = <LEFT_HAND_KEYS THUMB_KEYS>;
//hold-trigger-on-release; // don't wait for other mods
tapping-term-ms = <SHIFT_HOLDING_TIME>;
quick-tap-ms = <SHIFT_REPEAT_DECAY>;
require-prior-idle-ms = <SHIFT_STREAK_DECAY>;
#binding-cells = <2>;
bindings = <&kp>, <&kp>;
};
//
// Thumb cluster hold-tap keys for Miryoku layers
//
thumb: miryoku_thumb_layer {
compatible = "zmk,behavior-hold-tap";
label = "MIRYOKU_THUMB_LAYER";
flavor = THUMB_HOLDING_TYPE;
tapping-term-ms = <THUMB_HOLDING_TIME>;
quick-tap-ms = <THUMB_REPEAT_DECAY>; // enable repeat
//global-quick-tap; // no typing streak
//retro-tap; // don't allow slow (hold-like) taps
#binding-cells = <2>;
bindings = <&mo>, <&kp>;
};
space: miryoku_thumb_layer_spacebar {
compatible = "zmk,behavior-hold-tap";
label = "MIRYOKU_THUMB_LAYER_SPACEBAR";
flavor = THUMB_HOLDING_TYPE;
tapping-term-ms = <SPACE_HOLDING_TIME>;
quick-tap-ms = <SPACE_REPEAT_DECAY>; // enable repeat
//global-quick-tap; // no typing streak
retro-tap; // allow slow (hold-like) taps
#binding-cells = <2>;
bindings = <&mo>, <&kp>;
};
//////////////////////////////////////////////////////////////////////////
//
// Custom shifted pairs
//
//////////////////////////////////////////////////////////////////////////
//
// Shift + CapsWord = CapsLock
//
cappy: capsword_and_capslock {
compatible = "zmk,behavior-mod-morph";
label = "CAPSWORD_AND_CAPSLOCK";
#binding-cells = <0>;
bindings = <&caps_word>, <&kp CAPSLOCK>;
mods = <(MOD_LSFT|MOD_RSFT)>;
};
//
// Custom shifted pairs for the Engram layout
// - https://engram.dev/
// - https://sunaku.github.io/engram-keyboard-layout.html
//
engram_1: engram_one_and_pipe {
compatible = "zmk,behavior-mod-morph";
label = "ENGRAM_ONE_AND_PIPE";
#binding-cells = <0>;
bindings = <&kp N1>, <&kp PIPE>;
mods = <(MOD_LSFT|MOD_RSFT)>;
};
engram_2: engram_two_and_equal {
compatible = "zmk,behavior-mod-morph";
label = "ENGRAM_TWO_AND_EQUAL";
#binding-cells = <0>;
bindings = <&kp N2>, <&kp EQUAL>;
mods = <(MOD_LSFT|MOD_RSFT)>;
};
engram_3: engram_three_and_tilde {
compatible = "zmk,behavior-mod-morph";
label = "ENGRAM_THREE_AND_TILDE";
#binding-cells = <0>;
bindings = <&kp N3>, <&kp TILDE>;
mods = <(MOD_LSFT|MOD_RSFT)>;
};
engram_4: engram_four_and_plus {
compatible = "zmk,behavior-mod-morph";
label = "ENGRAM_FOUR_AND_PLUS";
#binding-cells = <0>;
bindings = <&kp N4>, <&kp PLUS>;
mods = <(MOD_LSFT|MOD_RSFT)>;
};
engram_5: engram_five_and_less_than {
compatible = "zmk,behavior-mod-morph";
label = "ENGRAM_FIVE_AND_LESS_THAN";
#binding-cells = <0>;
bindings = <&kp N5>, <&kp LESS_THAN>;
mods = <(MOD_LSFT|MOD_RSFT)>;
};
engram_6: engram_six_and_greater_than {
compatible = "zmk,behavior-mod-morph";
label = "ENGRAM_SIX_AND_GREATER_THAN";
#binding-cells = <0>;
bindings = <&kp N6>, <&kp GREATER_THAN>;
mods = <(MOD_LSFT|MOD_RSFT)>;
};
engram_7: engram_seven_and_caret {
compatible = "zmk,behavior-mod-morph";
label = "ENGRAM_SEVEN_AND_CARET";
#binding-cells = <0>;
bindings = <&kp N7>, <&kp CARET>;
mods = <(MOD_LSFT|MOD_RSFT)>;
};
engram_8: engram_eight_and_ampersand {
compatible = "zmk,behavior-mod-morph";
label = "ENGRAM_EIGHT_AND_AMPERSAND";
#binding-cells = <0>;
bindings = <&kp N8>, <&kp AMPERSAND>;
mods = <(MOD_LSFT|MOD_RSFT)>;
};
engram_9: engram_nine_and_percent {
compatible = "zmk,behavior-mod-morph";
label = "ENGRAM_NINE_AND_PERCENT";
#binding-cells = <0>;
bindings = <&kp N9>, <&kp PERCENT>;
mods = <(MOD_LSFT|MOD_RSFT)>;
};
engram_0: engram_zero_and_asterisk {
compatible = "zmk,behavior-mod-morph";
label = "ENGRAM_ZERO_AND_ASTERISK";
#binding-cells = <0>;
bindings = <&kp N0>, <&kp ASTERISK>;
mods = <(MOD_LSFT|MOD_RSFT)>;
};
engram_apos: engram_apostrophe_and_left_parenthesis {
compatible = "zmk,behavior-mod-morph";
label = "ENGRAM_APOSTROPHE_AND_LEFT_PARENTHESIS";
#binding-cells = <0>;
bindings = <&kp APOSTROPHE>, <&kp LEFT_PARENTHESIS>;
mods = <(MOD_LSFT|MOD_RSFT)>;
};
engram_dquote: engram_double_quotes_and_right_parenthesis {
compatible = "zmk,behavior-mod-morph";
label = "ENGRAM_DOUBLE_QUOTES_AND_RIGHT_PARENTHESIS";
#binding-cells = <0>;
bindings = <&kp DOUBLE_QUOTES>, <&kp RIGHT_PARENTHESIS>;
mods = <(MOD_LSFT|MOD_RSFT)>;
};
engram_comma: engram_comma_and_semicolon {
compatible = "zmk,behavior-mod-morph";
label = "ENGRAM_COMMA_AND_SEMICOLON";
#binding-cells = <0>;
bindings = <&kp COMMA>, <&kp SEMICOLON>;
mods = <(MOD_LSFT|MOD_RSFT)>;
};
engram_period: engram_period_and_colon {
compatible = "zmk,behavior-mod-morph";
label = "ENGRAM_PERIOD_AND_COLON";
#binding-cells = <0>;
bindings = <&kp PERIOD>, <&kp COLON>;
mods = <(MOD_LSFT|MOD_RSFT)>;
};
engram_question: engram_question_and_exclamation {
compatible = "zmk,behavior-mod-morph";
label = "ENGRAM_QUESTION_AND_EXCLAMATION";
#binding-cells = <0>;
bindings = <&kp QUESTION>, <&kp EXCLAMATION>;
mods = <(MOD_LSFT|MOD_RSFT)>;
};
engram_hash: engram_hash_and_dollar {
compatible = "zmk,behavior-mod-morph";
label = "ENGRAM_HASH_AND_DOLLAR";
#binding-cells = <0>;
bindings = <&kp HASH>, <&kp DOLLAR>;
mods = <(MOD_LSFT|MOD_RSFT)>;
};
engram_at: engram_at_and_grave {
compatible = "zmk,behavior-mod-morph";
label = "ENGRAM_AT_AND_GRAVE";
#binding-cells = <0>;
bindings = <&kp AT>, <&kp GRAVE>;
mods = <(MOD_LSFT|MOD_RSFT)>;
};
engram_slash: engram_slash_and_backslash {
compatible = "zmk,behavior-mod-morph";
label = "ENGRAM_SLASH_AND_BACKSLASH";
#binding-cells = <0>;
bindings = <&kp SLASH>, <&kp BACKSLASH>;
mods = <(MOD_LSFT|MOD_RSFT)>;
};
//////////////////////////////////////////////////////////////////////////
//
// ZMK global overrides
//
//////////////////////////////////////////////////////////////////////////
//
// CapsWord - ported from Pascal Getreuer's extension for QMK
// - https://zmk.dev/docs/behaviors/caps-word
// - https://getreuer.info/posts/keyboards/caps-word/index.html
//
behavior_caps_word {
continue-list = <
UNDERSCORE MINUS
BACKSPACE DELETE
N1 N2 N3 N4 N5 N6 N7 N8 N9 N0
>;
};
};
macros {
//////////////////////////////////////////////////////////////////////////
//
// Approximation of Pascal Getreuer's Select Word macro from QMK
// - https://getreuer.info/posts/keyboards/select-word/index.html
//
//////////////////////////////////////////////////////////////////////////
//
// SELECT_WORD_DELAY defines how long the macro waits (milliseconds)
// after moving the cursor before it selects a word. A larger delay
// may allow the macro to move to the next word upon each invocation.
//
#ifndef SELECT_WORD_DELAY
#define SELECT_WORD_DELAY 1
#endif
ZMK_MACRO(select_none,
wait-ms = <SELECT_WORD_DELAY>;
tap-ms = <SELECT_WORD_DELAY>;
bindings = <&kp DOWN &kp UP &kp RIGHT &kp LEFT>;
)
//
// select a word (jumps to next word upon each successive invocation)
//
select_word: select_word {
compatible = "zmk,behavior-mod-morph";
label = "SELECT_WORD";
#binding-cells = <0>;
bindings = <&select_word_right>, <&select_word_left>;
mods = <(MOD_LSFT|MOD_RSFT)>;
};
ZMK_MACRO(select_word_right,
wait-ms = <SELECT_WORD_DELAY>;
tap-ms = <SELECT_WORD_DELAY>;
bindings = <&kp LC(RIGHT) &kp LC(LEFT) &kp LC(LS(RIGHT))>;
)
ZMK_MACRO(select_word_left,
wait-ms = <SELECT_WORD_DELAY>;
tap-ms = <SELECT_WORD_DELAY>;
bindings = <&kp LC(LEFT) &kp LC(RIGHT) &kp LC(LS(LEFT))>;
)
//
// extend current selection by one word
//
extend_word: extend_word {
compatible = "zmk,behavior-mod-morph";
label = "EXTEND_WORD";
#binding-cells = <0>;
bindings = <&extend_word_right>, <&extend_word_left>;
mods = <(MOD_LSFT|MOD_RSFT)>;
};
ZMK_MACRO(extend_word_right,
wait-ms = <SELECT_WORD_DELAY>;
tap-ms = <SELECT_WORD_DELAY>;
bindings = <&kp LC(LS(RIGHT))>;
)
ZMK_MACRO(extend_word_left,
wait-ms = <SELECT_WORD_DELAY>;
tap-ms = <SELECT_WORD_DELAY>;
bindings = <&kp LC(LS(LEFT))>;
)
//
// select current line
//
select_line: select_line {
compatible = "zmk,behavior-mod-morph";
label = "SELECT_LINE";
#binding-cells = <0>;
bindings = <&select_line_right>, <&select_line_left>;
mods = <(MOD_LSFT|MOD_RSFT)>;
};
ZMK_MACRO(select_line_right,
wait-ms = <SELECT_WORD_DELAY>;
tap-ms = <SELECT_WORD_DELAY>;
bindings = <&kp HOME &kp LS(END)>;
)
ZMK_MACRO(select_line_left,
wait-ms = <SELECT_WORD_DELAY>;
tap-ms = <SELECT_WORD_DELAY>;
bindings = <&kp END &kp LS(HOME)>;
)
//
// extend current selection by one line
//
extend_line: extend_line {
compatible = "zmk,behavior-mod-morph";
label = "EXTEND_LINE";
#binding-cells = <0>;
bindings = <&extend_line_right>, <&extend_line_left>;
mods = <(MOD_LSFT|MOD_RSFT)>;
};
ZMK_MACRO(extend_line_right,
wait-ms = <SELECT_WORD_DELAY>;
tap-ms = <SELECT_WORD_DELAY>;
bindings = <&kp LS(DOWN) &kp LS(END)>;
)
ZMK_MACRO(extend_line_left,
wait-ms = <SELECT_WORD_DELAY>;
tap-ms = <SELECT_WORD_DELAY>;
bindings = <&kp LS(UP) &kp LS(HOME)>;
)
//////////////////////////////////////////////////////////////////////////
//
// World layer - international characters
//
//////////////////////////////////////////////////////////////////////////
//
// UNICODE_TARGET_OS defines which operating system you're targeting
// for use with the UNICODE() macro. This is needed because each OS
// has different shortcuts for typing Unicode characters as hexcodes.
//
// NOTE: You may need to enable Unicode hexadecimal input in your OS:
// - https://ladedu.com/how-to-enter-unicode-characters-on-a-mac/
// - https://unicode-explorer.com/articles/how-to-type-unicode-characters-in-linux
// - https://unicode-explorer.com/articles/how-to-type-unicode-characters-in-windows
//
#ifndef UNICODE_TARGET_OS
#define UNICODE_TARGET_OS 1 // linux
//#define UNICODE_TARGET_OS 2 // macos
//#define UNICODE_TARGET_OS 3 // windows
#endif
//
// UNICODE_TAP_DELAY defines how long the macro waits (milliseconds)
// between keystrokes while inputting the Unicode codepoint shortcut.
//
#ifndef UNICODE_TAP_DELAY
#define UNICODE_TAP_DELAY 1
#endif
//
// UNICODE_SEQ_DELAY defines how long the macro waits (milliseconds)
// between emitting Unicode codepoints in multi-codepoint characters.
//
#ifndef UNICODE_SEQ_DELAY
#define UNICODE_SEQ_DELAY 10
#endif
#define UNICODE(name, ...) \
ZMK_MACRO(name, \
wait-ms = <UNICODE_TAP_DELAY>; \
tap-ms = <UNICODE_TAP_DELAY>; \
bindings = __VA_ARGS__; \
)
//
// NOTE: edit the emoji.yaml file and run `rake` to generate this:
//
//
// codepoints
//
/* ° */ UNICODE(world_degree_sign,
#if UNICODE_TARGET_OS == 1
<&kp LC(LS(U)) &kp B &kp N0 &kp ENTER>
#elif UNICODE_TARGET_OS == 2
<¯o_press &kp LALT>, <¯o_tap &kp N0 &kp N0 &kp B &kp N0>, <¯o_release &kp LALT>
#elif UNICODE_TARGET_OS == 3
<¯o_press &kp LALT>, <¯o_tap &kp KP_PLUS &kp B &kp KP_N0>, <¯o_release &kp LALT>
#endif
)
/* § */ UNICODE(world_section_sign,
#if UNICODE_TARGET_OS == 1
<&kp LC(LS(U)) &kp A &kp N7 &kp ENTER>
#elif UNICODE_TARGET_OS == 2
<¯o_press &kp LALT>, <¯o_tap &kp N0 &kp N0 &kp A &kp N7>, <¯o_release &kp LALT>
#elif UNICODE_TARGET_OS == 3
<¯o_press &kp LALT>, <¯o_tap &kp KP_PLUS &kp A &kp KP_N7>, <¯o_release &kp LALT>
#endif
)
/* ¶ */ UNICODE(world_paragraph_sign,
#if UNICODE_TARGET_OS == 1
<&kp LC(LS(U)) &kp B &kp N6 &kp ENTER>
#elif UNICODE_TARGET_OS == 2
<¯o_press &kp LALT>, <¯o_tap &kp N0 &kp N0 &kp B &kp N6>, <¯o_release &kp LALT>
#elif UNICODE_TARGET_OS == 3
<¯o_press &kp LALT>, <¯o_tap &kp KP_PLUS &kp B &kp KP_N6>, <¯o_release &kp LALT>
#endif
)
/* º */ UNICODE(world_o_ordinal,
#if UNICODE_TARGET_OS == 1
<&kp LC(LS(U)) &kp B &kp A &kp ENTER>
#elif UNICODE_TARGET_OS == 2
<¯o_press &kp LALT>, <¯o_tap &kp N0 &kp N0 &kp B &kp A>, <¯o_release &kp LALT>
#elif UNICODE_TARGET_OS == 3
<¯o_press &kp LALT>, <¯o_tap &kp KP_PLUS &kp B &kp A>, <¯o_release &kp LALT>
#endif
)
/* ª */ UNICODE(world_a_ordinal,
#if UNICODE_TARGET_OS == 1
<&kp LC(LS(U)) &kp A &kp A &kp ENTER>
#elif UNICODE_TARGET_OS == 2
<¯o_press &kp LALT>, <¯o_tap &kp N0 &kp N0 &kp A &kp A>, <¯o_release &kp LALT>
#elif UNICODE_TARGET_OS == 3
<¯o_press &kp LALT>, <¯o_tap &kp KP_PLUS &kp A &kp A>, <¯o_release &kp LALT>
#endif
)
/* ¡ */ UNICODE(world_exclaim_left,
#if UNICODE_TARGET_OS == 1
<&kp LC(LS(U)) &kp A &kp N1 &kp ENTER>
#elif UNICODE_TARGET_OS == 2
<¯o_press &kp LALT>, <¯o_tap &kp N0 &kp N0 &kp A &kp N1>, <¯o_release &kp LALT>
#elif UNICODE_TARGET_OS == 3
<¯o_press &kp LALT>, <¯o_tap &kp KP_PLUS &kp A &kp KP_N1>, <¯o_release &kp LALT>
#endif
)
/* ¿ */ UNICODE(world_question_left,
#if UNICODE_TARGET_OS == 1
<&kp LC(LS(U)) &kp B &kp F &kp ENTER>
#elif UNICODE_TARGET_OS == 2
<¯o_press &kp LALT>, <¯o_tap &kp N0 &kp N0 &kp B &kp F>, <¯o_release &kp LALT>
#elif UNICODE_TARGET_OS == 3
<¯o_press &kp LALT>, <¯o_tap &kp KP_PLUS &kp B &kp F>, <¯o_release &kp LALT>
#endif
)
//
// characters
//
/* ç */ UNICODE(world_c_cedilla_lower,
#if UNICODE_TARGET_OS == 1
<&kp LC(LS(U)) &kp E &kp N7 &kp ENTER>
#elif UNICODE_TARGET_OS == 2
<¯o_press &kp LALT>, <¯o_tap &kp N0 &kp N0 &kp E &kp N7>, <¯o_release &kp LALT>
#elif UNICODE_TARGET_OS == 3
<¯o_press &kp LALT>, <¯o_tap &kp KP_PLUS &kp E &kp KP_N7>, <¯o_release &kp LALT>
#endif
)
/* Ç */ UNICODE(world_c_cedilla_upper,
#if UNICODE_TARGET_OS == 1
<&kp LC(LS(U)) &kp C &kp N7 &kp ENTER>
#elif UNICODE_TARGET_OS == 2
<¯o_press &kp LALT>, <¯o_tap &kp N0 &kp N0 &kp C &kp N7>, <¯o_release &kp LALT>
#elif UNICODE_TARGET_OS == 3
<¯o_press &kp LALT>, <¯o_tap &kp KP_PLUS &kp C &kp KP_N7>, <¯o_release &kp LALT>
#endif
)
world_c_cedilla: world_c_cedilla {
compatible = "zmk,behavior-mod-morph";
label = "WORLD_C_CEDILLA";
#binding-cells = <0>;
bindings = <&world_c_cedilla_lower>, <&world_c_cedilla_upper>;
mods = <MOD_LSFT>;
};
/* í */ UNICODE(world_i_acute_lower,
#if UNICODE_TARGET_OS == 1
<&kp LC(LS(U)) &kp E &kp D &kp ENTER>
#elif UNICODE_TARGET_OS == 2
<¯o_press &kp LALT>, <¯o_tap &kp N0 &kp N0 &kp E &kp D>, <¯o_release &kp LALT>
#elif UNICODE_TARGET_OS == 3
<¯o_press &kp LALT>, <¯o_tap &kp KP_PLUS &kp E &kp D>, <¯o_release &kp LALT>
#endif
)
/* Í */ UNICODE(world_i_acute_upper,
#if UNICODE_TARGET_OS == 1
<&kp LC(LS(U)) &kp C &kp D &kp ENTER>
#elif UNICODE_TARGET_OS == 2
<¯o_press &kp LALT>, <¯o_tap &kp N0 &kp N0 &kp C &kp D>, <¯o_release &kp LALT>
#elif UNICODE_TARGET_OS == 3
<¯o_press &kp LALT>, <¯o_tap &kp KP_PLUS &kp C &kp D>, <¯o_release &kp LALT>
#endif
)
world_i_acute: world_i_acute {
compatible = "zmk,behavior-mod-morph";
label = "WORLD_I_ACUTE";
#binding-cells = <0>;
bindings = <&world_i_acute_lower>, <&world_i_acute_upper>;
mods = <MOD_LSFT>;
};
/* ï */ UNICODE(world_i_diaeresis_lower,
#if UNICODE_TARGET_OS == 1
<&kp LC(LS(U)) &kp E &kp F &kp ENTER>
#elif UNICODE_TARGET_OS == 2
<¯o_press &kp LALT>, <¯o_tap &kp N0 &kp N0 &kp E &kp F>, <¯o_release &kp LALT>
#elif UNICODE_TARGET_OS == 3
<¯o_press &kp LALT>, <¯o_tap &kp KP_PLUS &kp E &kp F>, <¯o_release &kp LALT>
#endif
)
/* Ï */ UNICODE(world_i_diaeresis_upper,
#if UNICODE_TARGET_OS == 1
<&kp LC(LS(U)) &kp C &kp F &kp ENTER>
#elif UNICODE_TARGET_OS == 2
<¯o_press &kp LALT>, <¯o_tap &kp N0 &kp N0 &kp C &kp F>, <¯o_release &kp LALT>
#elif UNICODE_TARGET_OS == 3
<¯o_press &kp LALT>, <¯o_tap &kp KP_PLUS &kp C &kp F>, <¯o_release &kp LALT>
#endif
)
world_i_diaeresis: world_i_diaeresis {
compatible = "zmk,behavior-mod-morph";
label = "WORLD_I_DIAERESIS";
#binding-cells = <0>;
bindings = <&world_i_diaeresis_lower>, <&world_i_diaeresis_upper>;
mods = <MOD_LSFT>;
};
/* î */ UNICODE(world_i_circumflex_lower,
#if UNICODE_TARGET_OS == 1
<&kp LC(LS(U)) &kp E &kp E &kp ENTER>
#elif UNICODE_TARGET_OS == 2
<¯o_press &kp LALT>, <¯o_tap &kp N0 &kp N0 &kp E &kp E>, <¯o_release &kp LALT>
#elif UNICODE_TARGET_OS == 3
<¯o_press &kp LALT>, <¯o_tap &kp KP_PLUS &kp E &kp E>, <¯o_release &kp LALT>
#endif
)
/* Î */ UNICODE(world_i_circumflex_upper,
#if UNICODE_TARGET_OS == 1
<&kp LC(LS(U)) &kp C &kp E &kp ENTER>
#elif UNICODE_TARGET_OS == 2
<¯o_press &kp LALT>, <¯o_tap &kp N0 &kp N0 &kp C &kp E>, <¯o_release &kp LALT>
#elif UNICODE_TARGET_OS == 3
<¯o_press &kp LALT>, <¯o_tap &kp KP_PLUS &kp C &kp E>, <¯o_release &kp LALT>
#endif
)
world_i_circumflex: world_i_circumflex {
compatible = "zmk,behavior-mod-morph";
label = "WORLD_I_CIRCUMFLEX";
#binding-cells = <0>;
bindings = <&world_i_circumflex_lower>, <&world_i_circumflex_upper>;
mods = <MOD_LSFT>;
};
/* ì */ UNICODE(world_i_grave_lower,
#if UNICODE_TARGET_OS == 1
<&kp LC(LS(U)) &kp E &kp C &kp ENTER>
#elif UNICODE_TARGET_OS == 2
<¯o_press &kp LALT>, <¯o_tap &kp N0 &kp N0 &kp E &kp C>, <¯o_release &kp LALT>
#elif UNICODE_TARGET_OS == 3
<¯o_press &kp LALT>, <¯o_tap &kp KP_PLUS &kp E &kp C>, <¯o_release &kp LALT>
#endif
)
/* Ì */ UNICODE(world_i_grave_upper,
#if UNICODE_TARGET_OS == 1
<&kp LC(LS(U)) &kp C &kp C &kp ENTER>
#elif UNICODE_TARGET_OS == 2
<¯o_press &kp LALT>, <¯o_tap &kp N0 &kp N0 &kp C &kp C>, <¯o_release &kp LALT>
#elif UNICODE_TARGET_OS == 3
<¯o_press &kp LALT>, <¯o_tap &kp KP_PLUS &kp C &kp C>, <¯o_release &kp LALT>
#endif
)
world_i_grave: world_i_grave {
compatible = "zmk,behavior-mod-morph";
label = "WORLD_I_GRAVE";
#binding-cells = <0>;
bindings = <&world_i_grave_lower>, <&world_i_grave_upper>;
mods = <MOD_LSFT>;
};
/* é */ UNICODE(world_e_acute_lower,
#if UNICODE_TARGET_OS == 1
<&kp LC(LS(U)) &kp E &kp N9 &kp ENTER>
#elif UNICODE_TARGET_OS == 2
<¯o_press &kp LALT>, <¯o_tap &kp N0 &kp N0 &kp E &kp N9>, <¯o_release &kp LALT>
#elif UNICODE_TARGET_OS == 3
<¯o_press &kp LALT>, <¯o_tap &kp KP_PLUS &kp E &kp KP_N9>, <¯o_release &kp LALT>
#endif
)
/* É */ UNICODE(world_e_acute_upper,
#if UNICODE_TARGET_OS == 1
<&kp LC(LS(U)) &kp C &kp N9 &kp ENTER>
#elif UNICODE_TARGET_OS == 2
<¯o_press &kp LALT>, <¯o_tap &kp N0 &kp N0 &kp C &kp N9>, <¯o_release &kp LALT>
#elif UNICODE_TARGET_OS == 3
<¯o_press &kp LALT>, <¯o_tap &kp KP_PLUS &kp C &kp KP_N9>, <¯o_release &kp LALT>
#endif
)
world_e_acute: world_e_acute {
compatible = "zmk,behavior-mod-morph";
label = "WORLD_E_ACUTE";
#binding-cells = <0>;
bindings = <&world_e_acute_lower>, <&world_e_acute_upper>;
mods = <MOD_LSFT>;
};
/* ë */ UNICODE(world_e_diaeresis_lower,
#if UNICODE_TARGET_OS == 1
<&kp LC(LS(U)) &kp E &kp B &kp ENTER>
#elif UNICODE_TARGET_OS == 2
<¯o_press &kp LALT>, <¯o_tap &kp N0 &kp N0 &kp E &kp B>, <¯o_release &kp LALT>
#elif UNICODE_TARGET_OS == 3
<¯o_press &kp LALT>, <¯o_tap &kp KP_PLUS &kp E &kp B>, <¯o_release &kp LALT>
#endif
)
/* Ë */ UNICODE(world_e_diaeresis_upper,
#if UNICODE_TARGET_OS == 1
<&kp LC(LS(U)) &kp C &kp B &kp ENTER>
#elif UNICODE_TARGET_OS == 2
<¯o_press &kp LALT>, <¯o_tap &kp N0 &kp N0 &kp C &kp B>, <¯o_release &kp LALT>
#elif UNICODE_TARGET_OS == 3
<¯o_press &kp LALT>, <¯o_tap &kp KP_PLUS &kp C &kp B>, <¯o_release &kp LALT>
#endif
)
world_e_diaeresis: world_e_diaeresis {
compatible = "zmk,behavior-mod-morph";
label = "WORLD_E_DIAERESIS";
#binding-cells = <0>;
bindings = <&world_e_diaeresis_lower>, <&world_e_diaeresis_upper>;
mods = <MOD_LSFT>;
};
/* ê */ UNICODE(world_e_circumflex_lower,
#if UNICODE_TARGET_OS == 1
<&kp LC(LS(U)) &kp E &kp A &kp ENTER>
#elif UNICODE_TARGET_OS == 2
<¯o_press &kp LALT>, <¯o_tap &kp N0 &kp N0 &kp E &kp A>, <¯o_release &kp LALT>
#elif UNICODE_TARGET_OS == 3
<¯o_press &kp LALT>, <¯o_tap &kp KP_PLUS &kp E &kp A>, <¯o_release &kp LALT>
#endif
)
/* Ê */ UNICODE(world_e_circumflex_upper,
#if UNICODE_TARGET_OS == 1
<&kp LC(LS(U)) &kp C &kp A &kp ENTER>
#elif UNICODE_TARGET_OS == 2
<¯o_press &kp LALT>, <¯o_tap &kp N0 &kp N0 &kp C &kp A>, <¯o_release &kp LALT>
#elif UNICODE_TARGET_OS == 3
<¯o_press &kp LALT>, <¯o_tap &kp KP_PLUS &kp C &kp A>, <¯o_release &kp LALT>
#endif
)
world_e_circumflex: world_e_circumflex {
compatible = "zmk,behavior-mod-morph";
label = "WORLD_E_CIRCUMFLEX";
#binding-cells = <0>;
bindings = <&world_e_circumflex_lower>, <&world_e_circumflex_upper>;
mods = <MOD_LSFT>;
};
/* è */ UNICODE(world_e_grave_lower,
#if UNICODE_TARGET_OS == 1
<&kp LC(LS(U)) &kp E &kp N8 &kp ENTER>
#elif UNICODE_TARGET_OS == 2
<¯o_press &kp LALT>, <¯o_tap &kp N0 &kp N0 &kp E &kp N8>, <¯o_release &kp LALT>
#elif UNICODE_TARGET_OS == 3
<¯o_press &kp LALT>, <¯o_tap &kp KP_PLUS &kp E &kp KP_N8>, <¯o_release &kp LALT>
#endif
)
/* È */ UNICODE(world_e_grave_upper,
#if UNICODE_TARGET_OS == 1
<&kp LC(LS(U)) &kp C &kp N8 &kp ENTER>
#elif UNICODE_TARGET_OS == 2
<¯o_press &kp LALT>, <¯o_tap &kp N0 &kp N0 &kp C &kp N8>, <¯o_release &kp LALT>
#elif UNICODE_TARGET_OS == 3
<¯o_press &kp LALT>, <¯o_tap &kp KP_PLUS &kp C &kp KP_N8>, <¯o_release &kp LALT>
#endif
)
world_e_grave: world_e_grave {
compatible = "zmk,behavior-mod-morph";
label = "WORLD_E_GRAVE";
#binding-cells = <0>;
bindings = <&world_e_grave_lower>, <&world_e_grave_upper>;
mods = <MOD_LSFT>;
};
/* æ */ UNICODE(world_e_ae_lower,
#if UNICODE_TARGET_OS == 1
<&kp LC(LS(U)) &kp E &kp N6 &kp ENTER>
#elif UNICODE_TARGET_OS == 2
<¯o_press &kp LALT>, <¯o_tap &kp N0 &kp N0 &kp E &kp N6>, <¯o_release &kp LALT>
#elif UNICODE_TARGET_OS == 3
<¯o_press &kp LALT>, <¯o_tap &kp KP_PLUS &kp E &kp KP_N6>, <¯o_release &kp LALT>
#endif
)
/* Æ */ UNICODE(world_e_ae_upper,
#if UNICODE_TARGET_OS == 1
<&kp LC(LS(U)) &kp C &kp N6 &kp ENTER>
#elif UNICODE_TARGET_OS == 2
<¯o_press &kp LALT>, <¯o_tap &kp N0 &kp N0 &kp C &kp N6>, <¯o_release &kp LALT>
#elif UNICODE_TARGET_OS == 3
<¯o_press &kp LALT>, <¯o_tap &kp KP_PLUS &kp C &kp KP_N6>, <¯o_release &kp LALT>
#endif
)
world_e_ae: world_e_ae {
compatible = "zmk,behavior-mod-morph";
label = "WORLD_E_AE";
#binding-cells = <0>;
bindings = <&world_e_ae_lower>, <&world_e_ae_upper>;
mods = <MOD_LSFT>;
};
/* á */ UNICODE(world_a_acute_lower,
#if UNICODE_TARGET_OS == 1
<&kp LC(LS(U)) &kp E &kp N1 &kp ENTER>
#elif UNICODE_TARGET_OS == 2
<¯o_press &kp LALT>, <¯o_tap &kp N0 &kp N0 &kp E &kp N1>, <¯o_release &kp LALT>
#elif UNICODE_TARGET_OS == 3
<¯o_press &kp LALT>, <¯o_tap &kp KP_PLUS &kp E &kp KP_N1>, <¯o_release &kp LALT>
#endif
)
/* Á */ UNICODE(world_a_acute_upper,
#if UNICODE_TARGET_OS == 1
<&kp LC(LS(U)) &kp C &kp N1 &kp ENTER>
#elif UNICODE_TARGET_OS == 2
<¯o_press &kp LALT>, <¯o_tap &kp N0 &kp N0 &kp C &kp N1>, <¯o_release &kp LALT>
#elif UNICODE_TARGET_OS == 3
<¯o_press &kp LALT>, <¯o_tap &kp KP_PLUS &kp C &kp KP_N1>, <¯o_release &kp LALT>
#endif
)
world_a_acute: world_a_acute {
compatible = "zmk,behavior-mod-morph";
label = "WORLD_A_ACUTE";
#binding-cells = <0>;
bindings = <&world_a_acute_lower>, <&world_a_acute_upper>;
mods = <MOD_LSFT>;
};
/* ä */ UNICODE(world_a_diaeresis_lower,
#if UNICODE_TARGET_OS == 1
<&kp LC(LS(U)) &kp E &kp N4 &kp ENTER>
#elif UNICODE_TARGET_OS == 2
<¯o_press &kp LALT>, <¯o_tap &kp N0 &kp N0 &kp E &kp N4>, <¯o_release &kp LALT>
#elif UNICODE_TARGET_OS == 3
<¯o_press &kp LALT>, <¯o_tap &kp KP_PLUS &kp E &kp KP_N4>, <¯o_release &kp LALT>
#endif
)
/* Ä */ UNICODE(world_a_diaeresis_upper,
#if UNICODE_TARGET_OS == 1
<&kp LC(LS(U)) &kp C &kp N4 &kp ENTER>
#elif UNICODE_TARGET_OS == 2
<¯o_press &kp LALT>, <¯o_tap &kp N0 &kp N0 &kp C &kp N4>, <¯o_release &kp LALT>
#elif UNICODE_TARGET_OS == 3
<¯o_press &kp LALT>, <¯o_tap &kp KP_PLUS &kp C &kp KP_N4>, <¯o_release &kp LALT>
#endif
)