-
Notifications
You must be signed in to change notification settings - Fork 0
/
behaviors.dtsi
61 lines (53 loc) · 1.63 KB
/
behaviors.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
// vim: set ts=4 sw=4 ft=devicetree:
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
// TODO: once get used to, shorter the time.
// specific config for the home row tap, I am still slow
#define QUICK_TAP_MS 200
#define REQUIRE_PRIOR_IDLE_MS 150
#define TAPPING_TERM_MS 250
// make home row mode based on hold-tap
// TODO: hold-trigger-on-release require Patch,
// https://github.com/celejewski/zmk/commit/d7a8482712d87963e59b74238667346221199293
#define MAKE_HRM(name, trigger_keys) \
/ { \
behaviors { \
name: name { \
compatible = "zmk,behavior-hold-tap"; \
#binding-cells = <2>; \
flavor = "balanced"; \
tapping-term-ms = <TAPPING_TERM_MS>; \
quick-tap-ms = <QUICK_TAP_MS>; \
require-prior-idle-ms = <REQUIRE_PRIOR_IDLE_MS>; \
bindings = <&kp>, <&kp>; \
hold-trigger-key-positions = <trigger_keys>; \
hold-trigger-on-release; \
}; \
}; \
};
MAKE_HRM(hml, KEYS_R THUMBS)
MAKE_HRM(hmr, KEYS_L THUMBS)
< {
tapping-term-ms = <TAPPING_TERM_MS>;
quick-tap-ms = <QUICK_TAP_MS>;
require-prior-idle-ms = <REQUIRE_PRIOR_IDLE_MS>;
};
&sk {
release-after-ms = <1500>;
quick-release;
};
&mt {
flavor = "tap-preferred";
tapping-term-ms = <TAPPING_TERM_MS>;
quick-tap-ms = <QUICK_TAP_MS>;
};
// Alt+Tab swapper
/ {
behaviors {
swapper: swapper {
compatible = "zmk,behavior-tri-state";
#binding-cells = <0>;
bindings = <&kt LALT>, <&kp TAB>, <&kt LALT>;
};
};
};