-
Notifications
You must be signed in to change notification settings - Fork 0
/
34.dtsi
227 lines (204 loc) · 8.55 KB
/
34.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
#include <behaviors.dtsi>
#include <dt-bindings/zmk/backlight.h>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/outputs.h>
#include <dt-bindings/zmk/rgb.h>
&caps_word {
continue-list = <UNDERSCORE MINUS BSPC DEL N1 N2 N3 N4 N5 N6 N7 N8 N9 N0>;
};
&soft_off {
hold-time-ms = <5000>; // Only turn off it the key is held for 5 seconds or longer.
};
// hold-preferred: trigger hold when other key is *pressed*
// balanced: trigger hold when other key is *pressed and released*
&mt {
flavor = "hold-preferred";
tapping-term-ms = <200>;
quick-tap-ms = <180>;
};
< {
flavor = "balanced";
tapping-term-ms = <200>;
quick-tap-ms = <180>;
};
#define L1(k1) < 1 k1
#define SYM(k1) < 1 k1
#define L2(k1) < 2 k1
#define NAV(k1) < 2 k1
#define NUM(k1) < 2 k1
#define L3(k1) < 3 k1
#define CFG(k1) < 3 k1
// Alt when hold,k1 when tap
#define LAT(k1) &ht LALT k1
// GUI when hold, k1 when tap
#define LGT(k1) &ht LGUI k1
// shift when hold, k1 when tap
#define ST(k1) &ht LSHFT k1
// Ctrl when hold, k1 when tap
#define CT(k1) &ht LCTRL k1
// rgb
#define UG(k1) &rgb_ug k1
// hold preferred makes it easier to trigger hold
#define HOLD_PREFER_GUI(k1) &hp LGUI k1
// Hold GUI + x key press
#define HG(k1) &kp LG(k1)
#define ENTER &hp LGUI RET
#define BT(k1) &bt BT_SEL k1
#define BTC &bt BT_CLR_ALL
#define BOOT &bootloader
// == layout and key index ==
//
// +---------------+---------------+
// | 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|--------+
// +------+------+
/ {
combos {
compatible = "zmk,combos";
combo_df_esc {
timeout-ms = <50>;
key-positions = <12 13>;
bindings = <&kp ESC>;
};
combo_qw_esc {
timeout-ms = <50>;
key-positions = <0 1>;
bindings = <&kp ESC>;
};
combo_vol_down {
bindings = <&kp C_VOL_DN>;
key-positions = <26 27>;
};
combo_vol_up {
bindings = <&kp C_VOL_UP>;
key-positions = <27 28>;
};
combo_caps_word {
bindings = <&caps_word>;
key-positions = <13 16>;
};
/* lock { */
/* timeout-ms = <50>; */
/* key-positions = <0 9 20 29>; */
/* bindings = <&to 4>; */
/* }; */
/* unlock { */
/* timeout-ms = <50>; */
/* key-positions = <1 8 21 28>; */
/* bindings = <&to 0>; */
/* }; */
/* combo_sticky_gui { */
/* bindings = <&sk LGUI>; */
/* key-positions = <14 24>; */
/* }; */
/* combo_bspc { */
/* bindings = <&kp BACKSPACE>; */
/* key-positions = <3 4>; */
/* }; */
/* combo_sticky_ctrl_shift { */
/* bindings = <&sk LC(LSHFT)>; */
/* key-positions = <10 20>; */
/* }; */
/* combo_layer_3 { */
/* bindings = <&to 3>; */
/* key-positions = <0 9>; */
/* }; */
};
behaviors {
hp: hold_preferred {
label = "HOLD PREFERRED";
compatible = "zmk,behavior-hold-tap";
#binding-cells = <2>;
flavor = "hold-preferred";
tapping-term-ms = <200>;
quick-tap-ms = <180>;
bindings = <&kp>, <&kp>;
};
ht: hold_tap {
label = "TAP_HOLD";
compatible = "zmk,behavior-hold-tap";
#binding-cells = <2>;
flavor = "balanced";
tapping-term-ms = <200>;
quick-tap-ms = <180>;
bindings = <&kp>, <&kp>;
};
td0: td_0 {
compatible = "zmk,behavior-tap-dance";
label = "GUI_BACKTICK";
#binding-cells = <0>;
tapping-term-ms = <200>;
bindings = <&kp LG(GRAVE)>;
};
};
//############################################################################################################
// * Having enter on left side to hit action when right hand operate mouse
//############################################################################################################
keymap {
compatible = "zmk,keymap";
label = "3x5 keymap";
base {
bindings = <
//+---------+---------+---------+---------+---------+/* */+---------+---------+---------+---------+---------+
&kp Q &kp W &kp E &kp R LAT(T) /* */ &kp Y &kp U &kp I &kp O &kp P
//+---------+---------+---------+---------+---------+/* */+---------+---------+---------+---------+---------+
CT(A) NAV(S) &kp D ST(F) &kp G /* */ &kp H ST(J) &kp K NUM(L) CT(SEMI)
//+---------+---------+---------+---------+---------+/* */+---------+---------+---------+---------+---------+
CFG(Z) LGT(X) &kp C &kp V &kp B /* */ &kp N &kp M &kp COMMA &kp DOT &kp FSLH
//+---------+---------+---------+---------+---------+/* */+---------+---------+---------+---------+---------+
ENTER NUM(SPACE)/* */ SYM(BSPC) LAT(TAB)
//================================================
>;
};
symbols {
bindings = <
//+---------+---------+---------+---------+---------+/* */+---------+---------+---------+---------+---------+
&kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT /* */ &kp CARET &kp AMPS &kp STAR &none &kp N0
//+---------+---------+---------+---------+---------+/* */+---------+---------+---------+---------+---------+
&kp DQT &kp UNDER &kp GRAVE &kp SQT &kp MINUS /* */ &kp COLON &kp LPAR &kp RPAR &kp LBKT &kp RBKT
//+---------+---------+---------+---------+---------+/* */+---------+---------+---------+---------+---------+
&kp BSLH &kp PIPE &kp TILDE &kp EQUAL &kp PLUS /* */ &kp LBRC &kp RBRC &kp LT &kp GT &kp QMARK
//+---------+---------+---------+---------+---------+/* */+---------+---------+---------+---------+---------+
&trans &trans /* */ &trans &trans
//================================================
>;
};
numbers {
bindings = <
//+---------+---------+---------+---------+---------+/* */+---------+---------+---------+---------+---------+
&kp N1 &kp N2 &kp N3 &kp SLASH &kp STAR /* */ &kp HOME &kp PG_DN &kp PG_UP &kp END BT(0)
//+---------+---------+---------+---------+---------+/* */+---------+---------+---------+---------+---------+
&kp N4 &kp N5 &kp N6 &kp DOT &kp MINUS /* */ &kp LEFT &kp DOWN &kp UP &kp RIGHT BT(1)
//+---------+---------+---------+---------+---------+/* */+---------+---------+---------+---------+---------+
&kp N7 &kp N8 &kp N9 &kp N0 &kp PLUS /* */ &none HG(DOWN) HG(UP) &none BT(2)
//+---------+---------+---------+---------+---------+/* */+---------+---------+---------+---------+---------+
&trans &trans /* */ &trans &trans
//================================================
>;
};
config {
bindings = <
//+---------+---------+---------+------+---------+/* */+------------+---------+---------+-----------+-----------+
BTC &none &none &none BT(0) /* */ &none &none &none UG(RGB_EFF) UG(RGB_TOG)
//+---------+---------+---------+------+---------+/* */+------------+---------+---------+-----------+-----------+
&none BOOT &soft_off &none BT(1) /* */ &out OUT_USB &none &soft_off &none UG(RGB_BRI)
//+---------+---------+---------+------+---------+/* */+------------+---------+---------+-----------+-----------+
&none &none &none &none BT(2) /* */ &out OUT_BLE &none &none &none UG(RGB_BRD)
//+---------+---------+---------+------+---------+/* */+------------+---------+---------+-----------+-----------+
&to 0 &kp PSCRN /* */ &trans &trans
//================================================
>;
};
blank {
bindings = <
&none &none &none &none &none /* */ &none &none &none &none &none
&none &none &none &none &none /* */ &none &none &none &none &none
&none &none &none &none &none /* */ &none &none &none &none &none
&none &none /* */ &none &none
>;
};
};
};