summaryrefslogtreecommitdiff
path: root/config/cradio.keymap
blob: 5618d3e11465f252e9903cd305bcee53e109f582 (plain)
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
/*
 * Copyright (c) 2020 The ZMK Contributors
 *
 * SPDX-License-Identifier: MIT
 */

#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/outputs.h>
#include <behaviors.dtsi>

#define COLEMAK 0
#define NAV 1
#define NUM 2
#define SYM 3
#define FUN 4

/* krita base */
#define KRB 5

/* play */
#define PLAY 6


&mt {
  flavor = "tap-preferred";
  tapping_term_ms = <200>;
  quick_tap_ms = <75>;
};

#define ZMK_HELPER_STRINGIFY(x) #x

/* ZMK_BEHAVIOR */

#define ZMK_BEHAVIOR_CORE_caps_word       compatible = "zmk,behavior-caps-word";       #binding-cells = <0>
#define ZMK_BEHAVIOR_CORE_dynamic_macro   compatible = "zmk,behavior-dynamic-macro";   #binding-cells = <1>
#define ZMK_BEHAVIOR_CORE_hold_tap        compatible = "zmk,behavior-hold-tap";        #binding-cells = <2>
#define ZMK_BEHAVIOR_CORE_key_repeat      compatible = "zmk,behavior-key-repeat";      #binding-cells = <0>
#define ZMK_BEHAVIOR_CORE_macro           compatible = "zmk,behavior-macro";           #binding-cells = <0>
#define ZMK_BEHAVIOR_CORE_macro_one_param compatible = "zmk,behavior-macro-one-param"; #binding-cells = <1>
#define ZMK_BEHAVIOR_CORE_macro_two_param compatible = "zmk,behavior-macro-two-param"; #binding-cells = <2>
#define ZMK_BEHAVIOR_CORE_mod_morph       compatible = "zmk,behavior-mod-morph";       #binding-cells = <0>
#define ZMK_BEHAVIOR_CORE_sticky_key      compatible = "zmk,behavior-sticky-key";      #binding-cells = <1>
#define ZMK_BEHAVIOR_CORE_tap_dance       compatible = "zmk,behavior-tap-dance";       #binding-cells = <0>
#define ZMK_BEHAVIOR_CORE_tri_state       compatible = "zmk,behavior-tri-state";       #binding-cells = <0>

#define ZMK_BEHAVIOR(name, type, ...) \
    / { \
        behaviors { \
            name: name { \
                label = ZMK_HELPER_STRINGIFY(ZB_ ## name); \
                ZMK_BEHAVIOR_CORE_ ## type; \
                __VA_ARGS__ \
            }; \
        }; \
    };

#define KEYS_L 0 1 2 3 4 10 11 12 13 14 20 21 22 23 24
#define KEYS_R 5 6 7 8 9 15 16 17 18 19 25 26 27 28 29
#define THUMBS 30 31 32 33

/* left-hand HRMs */
ZMK_BEHAVIOR(ml, hold_tap,
        flavor = "balanced";
        tapping-term-ms = <280>;
        quick-tap-ms = <175>;                // repeat on tap-into-hold
        bindings = <&kp>, <&kp>;
        hold-trigger-key-positions = <KEYS_R THUMBS>;
        hold-trigger-on-release;             // delay positional check until key-release
        global-quick-tap;
        )

/* right-hand HRMs */
ZMK_BEHAVIOR(mr, hold_tap,
        flavor = "balanced";
        tapping-term-ms = <280>;
        quick-tap-ms = <175>;
        bindings = <&kp>, <&kp>;
        hold-trigger-key-positions = <KEYS_L THUMBS>;
        hold-trigger-on-release;             // delay positional check until key-release
        global-quick-tap;
        )

/ { 

    combos {
        compatible = "zmk,combos";
        combo_caps_word {
            timeout-ms = <100>;
            key-positions = <20 29>;
            bindings = <&caps_word>;
        };
        combo_esc {
            timeout-ms = <150>;
            key-positions = <12 13 16 17>;
            bindings = <&kp ESC>;
        };
        combo_minus {
            timeout-ms = <100>;
            key-positions = <2 3 6 7>;
            bindings = <&kp MINUS>;
        };
        combo_under {
            timeout-ms = <100>;
            key-positions = <22 23 26 27>;
            bindings = <&kp UNDER>;
        };
        combo_ble {
            timeout-ms = <20>;
            key-positions = <0 1>;
            bindings = <&out OUT_BLE>;
        };
        combo_krita {
            timeout-ms = <100>;
            key-positions = <0 10 20>;
            bindings = <&tog KRB>;
        };
        combo_draw {
            timeout-ms = <100>;
            key-positions = <9 19 29>;
            bindings = <&tog PLAY>;
        };
    };

    keymap {
        compatible = "zmk,keymap";
        default_layer {
            bindings = <
                  &kp Q      &kp W       &kp F        &kp P        &kp G                          &kp J                     &kp L       &kp U           &kp Y        &kp SCLN
                  &ml LGUI A &ml LALT R  &ml LSHIFT S &ml LCTRL T  &ml LG(LA(LS(LCTRL))) D        &mr LG(LA(LS(LCTRL))) H   &mr LCTRL N &mr RSHIFT E    &mr LALT I   &mr LGUI O
                  &kp Z      &kp X       &kp C        &kp V        &kp B                          &kp K                     &kp M       &kp CMMA        &kp DOT      &kp FSLH
                                                      &lt FUN TAB  &lt NAV SPC                    &lt SYM RET               &lt NUM BSPC
                >;
        };

        nav_layer {
            bindings = <
                &bt BT_CLR   &trans &trans &bootloader &sys_reset           &trans      &kp LBRC   &kp RBRC &kp LPAR    &kp RPAR
                &bt BT_SEL 0 &trans &trans &trans      &trans               &kp LEFT    &kp DOWN   &kp UP   &kp RIGHT   &trans
                &bt BT_SEL 1 &trans &trans &trans      &trans               &trans      &kp LBKT   &kp RBKT &trans      &trans
                                           &trans      &trans               &trans      &trans
                >;
        };

        num_layer {
            bindings = <
                &trans     &kp F7 &kp F8 &kp F9 &trans                &trans    &trans   &trans &trans    &trans
                &kp SQT    &kp F4 &kp F5 &kp F6 &kp EQUAL             &trans    &trans   &trans &trans    &trans
                &kp GRAVE  &kp F1 &kp F2 &kp F3 &kp BSLH              &trans    &trans   &trans &trans    &trans
                                         &trans &trans                &trans    &trans
                >;
       };

       sym_layer {
            bindings = <
                &kp LS(Q) &kp LS(Z) &kp STAR  &kp AMPS  &trans                &sys_reset &bootloader   &trans &trans    &trans
                &kp DQT   &kp CARET &kp PRCNT &kp DLLR  &kp KP_PLUS           &trans     &trans        &trans &trans    &trans
                &kp TILDE &kp HASH  &kp AT    &kp EXCL  &kp PIPE              &trans     &trans        &trans &trans    &trans
                                              &kp LPAR  &kp RPAR              &trans     &trans
                >;
        };

       fun_layer {
            bindings = <
                &trans &trans &trans &trans &trans        &trans &kp N7    &kp N8    &kp N9    &trans
                &trans &trans &trans &trans &trans        &trans &kp N4    &kp N5    &kp N6    &trans
                &trans &trans &trans &trans &trans        &trans &kp N1    &kp N2    &kp N3    &trans
                                     &trans &trans        &trans &kp N0
                >;
        };

        krita_base_layer {
            bindings = <
                &kp M      &trans &kp BSLH  &kp LBKT      &kp RBKT       &trans    &trans   &trans &trans    &trans
                &trans     &trans &kp F     &kp I         &kp O          &trans    &trans   &trans &trans    &trans
                &kp LC(S)  &trans &kp P     &kp K         &kp L          &trans    &trans   &trans &trans    &trans
                                            &kp LS(LC(Z)) &kp LC(Z)      &trans    &trans
                >;
       };

        draw {
            bindings = <
                &kp Q   &kp W  &kp E     &kp R         &kp T          &kp Y     &kp U         &kp I          &kp O      &kp P
                &kp N1  &kp S  &kp N3    &ml LCTRL F   &kp G          &kp H     &mr LCTRL J   &mr RSHIFT K   &mr LALT L &mr LGUI SCLN
                &kp Z   &kp X  &kp C     &kp V         &kp B          &kp M     &kp LEFT      &kp DOWN       &kp RIGHT  &trans
                                         &kp R         &kp U          &kp RET   &kp BSPC
                >;
       };
    };
};