-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathbehaviours_homerow_mods.dtsi
102 lines (82 loc) · 3.09 KB
/
behaviours_homerow_mods.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
// Make sure settings.dtsi is included before this file
#define HM_TAPPING_TERM 300
#define HM_TAPPING_TERM_FAST 200
#define HM_PRIOR_IDLE 150
/ {
behaviors {
// Positional Homerow mods
// Homerow mods that prevent accidental activations when rolling keys,
// such as when typing `st` or `ne` on colemak-dh layouts or `as` on
// qwerty.
//
// Works by only allowing a mod to activate within tapping-term if
// it's on the opposite side of the keyboard or on the same side thumb
// keys.
// Further optimization using urob's timerless homerow mods method:
// https://github.com/urob/zmk-config#timeless-homerow-mods
hm_l: homerow_mods_left {
compatible = "zmk,behavior-hold-tap";
#binding-cells = <2>;
bindings = <&kp>, <&kp>;
flavor = "balanced";
tapping-term-ms = <HM_TAPPING_TERM>;
quick-tap-ms = <175>; // repeat on tap-into-hold
require-prior-idle-ms = <HM_PRIOR_IDLE>;
hold-trigger-key-positions = <KEYS_R KEYS_T>;
hold-trigger-on-release;
};
hm_r: homerow_mods_right {
compatible = "zmk,behavior-hold-tap";
#binding-cells = <2>;
bindings = <&kp>, <&kp>;
flavor = "balanced";
tapping-term-ms = <HM_TAPPING_TERM>;
quick-tap-ms = <175>;
require-prior-idle-ms = <HM_PRIOR_IDLE>;
hold-trigger-key-positions = <KEYS_L KEYS_T>;
hold-trigger-on-release;
};
// Positional Homerow mods for shift
// Use faster tapping term and disable some features that may
// cause false negatives.
hm_shift_l: hm_shift_l {
compatible = "zmk,behavior-hold-tap";
#binding-cells = <2>;
bindings = <&kp>, <&kp>;
flavor = "balanced";
tapping-term-ms = <HM_TAPPING_TERM_FAST>;
quick-tap-ms = <175>;
require-prior-idle-ms = <HM_PRIOR_IDLE>;
hold-trigger-key-positions = <KEYS_R KEYS_T>;
// hold-trigger-on-release;
};
hm_shift_r: hm_shift_r {
compatible = "zmk,behavior-hold-tap";
#binding-cells = <2>;
bindings = <&kp>, <&kp>;
flavor = "balanced";
tapping-term-ms = <HM_TAPPING_TERM_FAST>;
quick-tap-ms = <175>;
require-prior-idle-ms = <HM_PRIOR_IDLE>;
hold-trigger-key-positions = <KEYS_L KEYS_T>;
// hold-trigger-on-release;
};
/*
* Non-Positional Homerow Mods
* Used for &mm_grescm_gui behavior on left hand.
*
* Usage: &hm LSHFT T
* Tap: T
* Tap-Tap-Hold: Repeat T
* Hold: LSHIFT
*/
hm: homerow_mods {
compatible = "zmk,behavior-hold-tap";
#binding-cells = <2>;
bindings = <&kp>, <&kp>;
flavor = "balanced";
tapping-term-ms = <HM_TAPPING_TERM>;
quick-tap-ms = <200>;
};
};
};