|
3 | 3 | #include <dt-bindings/zmk/bt.h>
|
4 | 4 | #include <dt-bindings/zmk/outputs.h>
|
5 | 5 |
|
6 |
| -#define DEFAULT 0 // Default layer |
7 |
| -#define L_MAC 1 // Mac overlay |
8 |
| -#define L_SH 2 // Single Hand layer |
9 |
| -#define L_SHM 3 // Single Hand Mirror layer |
10 |
| -#define L_L 4 // Lower layer |
11 |
| -#define L_GAME 5 // Gaming overlay |
12 |
| -#define L_SET 6 // Settings layer |
| 6 | +#define KDEF 0 // Default layer |
| 7 | +#define KMAC 1 // Mac overlay |
| 8 | +#define KSH 2 // Single Hand layer |
| 9 | +#define KSHM 3 // Single Hand Mirror layer |
| 10 | +#define KLOW 4 // Lower layer |
| 11 | +#define KGAM 5 // Gaming overlay |
| 12 | +#define KSET 6 // Settings layer |
13 | 13 |
|
14 | 14 | // Modifiers
|
15 | 15 | #define HYPER(key) LS(LC(LA(LG(key)))) // LSHFT+LCTRL+LALT+LGUI
|
|
41 | 41 | };
|
42 | 42 | };
|
43 | 43 |
|
| 44 | + macros { |
| 45 | + /** |
| 46 | + * Temporarily switches to a layer (`&mo`) while a modifier is held. |
| 47 | + * Analogous to QMK's `LM()`, using a parameterized macro. |
| 48 | + * |
| 49 | + * Params: |
| 50 | + * 1. Layer to switch to |
| 51 | + * 2. Modifier to press while layer is active |
| 52 | + * |
| 53 | + * Example: |
| 54 | + * `&lm NUM_LAYER LSHIFT` |
| 55 | + */ |
| 56 | + lm: lm { |
| 57 | + compatible = "zmk,behavior-macro-two-param"; |
| 58 | + wait-ms = <0>; |
| 59 | + tap-ms = <0>; |
| 60 | + #binding-cells = <2>; |
| 61 | + bindings |
| 62 | + = <¯o_param_1to1> |
| 63 | + , <¯o_press &mo MACRO_PLACEHOLDER> |
| 64 | + , <¯o_param_2to1> |
| 65 | + , <¯o_press &kp MACRO_PLACEHOLDER> |
| 66 | + , <¯o_pause_for_release> |
| 67 | + , <¯o_param_2to1> |
| 68 | + , <¯o_release &kp MACRO_PLACEHOLDER> |
| 69 | + , <¯o_param_1to1> |
| 70 | + , <¯o_release &mo MACRO_PLACEHOLDER> |
| 71 | + ; |
| 72 | + }; |
| 73 | + }; |
| 74 | + |
44 | 75 | keymap {
|
45 | 76 | compatible = "zmk,keymap";
|
46 | 77 |
|
|
49 | 80 | bindings = <
|
50 | 81 | &kp ESC &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS
|
51 | 82 | &kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSLH
|
52 |
| -< L_L CAPS &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT |
| 83 | +< KLOW CAPS &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT |
53 | 84 | &kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT
|
54 | 85 | &kp GRAVE &kp BSLH &kp LEFT &kp RIGHT &kp DOWN &kp UP &kp LBKT &kp RBKT
|
55 |
| - &kp ALTGR &kp MINUS &kp LBKT &kp RBKT |
56 |
| - &kp EQUAL &kp BSPC |
| 86 | + &kp EQUAL &kp MINUS &kp LBKT &kp RBKT |
| 87 | + &kp GRAVE &kp BSPC |
57 | 88 | &kp LCTRL &kp LALT &kp LGUI &kp DEL &kp RET &kp SP
|
58 | 89 | >;
|
59 | 90 | };
|
|
77 | 108 | bindings = <
|
78 | 109 | &kp EQUAL &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS
|
79 | 110 | &kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSLH
|
80 |
| -&trans &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI < L_L CAPS |
| 111 | +&trans &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI < KLOW CAPS |
81 | 112 | &kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT
|
82 | 113 | &kp GRAVE &kp SQT &kp LCTRL &kp LALT &kp LALT &kp RCTRL &kp LBKT &kp RBKT
|
83 | 114 | &kp ALTGR &kp ESC &kp ESC &kp ALTGR
|
84 | 115 | &bsdel &bsdel
|
85 |
| - < L_SHM SP &kp RET &kp LGUI &kp LGUI &kp RET < L_SHM SP |
| 116 | + < KSHM SP &kp RET &kp LGUI &kp LGUI &kp RET < KSHM SP |
86 | 117 | >;
|
87 | 118 | };
|
88 | 119 |
|
|
104 | 135 | display-name = "Lower";
|
105 | 136 | bindings = <
|
106 | 137 | &kp F12 &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11
|
107 |
| -&mo L_SET &kp LC(1) &kp LC(PG_UP) &kp LC(PG_DN) &kp LC(9) &none &none &kp LC(1) &kp LC(PG_UP) &kp LC(PG_DN) &kp LC(9) &mo L_SET |
| 138 | +&mo KSET &kp LC(1) &kp LC(PG_UP) &kp LC(PG_DN) &kp LC(9) &none &none &kp LC(1) &kp LC(PG_UP) &kp LC(PG_DN) &kp LC(9) &mo KSET |
108 | 139 | &trans &none &kp LEFT &kp DOWN &kp UP &kp RIGHT &kp LEFT &kp DOWN &kp UP &kp RIGHT &none &trans
|
109 | 140 | &trans &kp LG(TAB) &kp GC(LEFT) &kp GC(RIGHT) &kp MEH(N) &kp MEH(M) &kp MEH(N) &kp MEH(M) &kp GC(LEFT) &kp GC(RIGHT) &kp LG(TAB) &trans
|
110 | 141 | &none &kp C_PP &kp C_PREV &kp C_NEXT &kp VOL_DN &kp VOL_UP &kp C_MUTE &none
|
111 | 142 | &kp BRI_UP &kp BRI_DN &kp PSCRN &kp INS
|
112 | 143 | &kp HOME &kp PG_UP
|
113 |
| - &trans &trans &kp END &kp PG_DN &trans &trans |
| 144 | + &trans &lm KDEF RALT &kp END &kp PG_DN &trans &trans |
114 | 145 | >;
|
115 | 146 | };
|
116 | 147 |
|
117 | 148 | game_layer {
|
118 | 149 | display-name = "Gaming";
|
119 | 150 | bindings = <
|
120 |
| -&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &tog L_GAME |
| 151 | +&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &tog KGAM |
121 | 152 | &kp TAB &kp T &kp Q &kp W &kp E &kp R &trans &trans &trans &trans &trans &trans
|
122 | 153 | &kp G &kp LSHFT &kp A &kp S &kp D &kp F &trans &trans &trans &trans &trans &trans
|
123 | 154 | &kp M &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
|
132 | 163 | display-name = "Settings";
|
133 | 164 | bindings = <
|
134 | 165 | &none &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &none &none &none &none &none &none
|
135 |
| -&mo L_SET &out OUT_USB &out OUT_BLE &none &sys_reset &none &none &sys_reset &none &none &none &none |
136 |
| -&trans &tog L_MAC &tog L_SH &none &none &to L_GAME &none &none &none &none &none &none |
| 166 | +&mo KSET &out OUT_USB &out OUT_BLE &none &sys_reset &none &none &sys_reset &none &none &none &none |
| 167 | +&trans &tog KMAC &tog KSH &none &none &to KGAM &none &none &none &none &none &none |
137 | 168 | &none &none &bt BT_CLR &none &none &bootloader &bootloader &none &none &none &none &none
|
138 | 169 | &none &none &none &none &none &none &none &none
|
139 | 170 | &none &none &none &none
|
|
0 commit comments