feat: reuse home row mods

This commit is contained in:
Bastien Riviere 2024-05-10 16:44:35 +02:00
parent f7a27c6ea8
commit 1636037308
Signed by: babariviere
GPG key ID: 4E5F0839249F162E
3 changed files with 29 additions and 52 deletions

View file

@ -23,6 +23,9 @@
#define SPC_NUM &lt NUM SPACE #define SPC_NUM &lt NUM SPACE
#define HRML(k1,k2,k3) &hml LCMD k1 &hml LALT k2 &hml LCTRL k3
#define HRMR(k1,k2,k3) &hmr LCTRL k1 &hmr LALT k2 &hmr LCMD k3
&sk { &sk {
release-after-ms = <2000>; release-after-ms = <2000>;
@ -45,14 +48,28 @@
/ { / {
behaviors { behaviors {
ht: hold_tap { hml: hml {
compatible = "zmk,behavior-hold-tap"; compatible = "zmk,behavior-hold-tap";
flavor = "balanced";
tapping-term-ms = <280>;
quick-tap-ms = <175>; // repeat on tap-into-hold
require-prior-idle-ms = <150>;
#binding-cells = <2>; #binding-cells = <2>;
flavor = "tap-preferred";
tapping-term-ms = <220>;
quick-tap-ms = <150>;
require-prior-idle-ms = <100>;
bindings = <&kp>, <&kp>; bindings = <&kp>, <&kp>;
hold-trigger-key-positions = <KEYS_R THUMBS>;
hold-trigger-on-release; // delay positional check until key-release
};
hmr: hmr {
compatible = "zmk,behavior-hold-tap";
flavor = "balanced";
tapping-term-ms = <280>;
quick-tap-ms = <175>; // repeat on tap-into-hold
require-prior-idle-ms = <150>;
#binding-cells = <2>;
bindings = <&kp>, <&kp>;
hold-trigger-key-positions = <KEYS_L THUMBS>;
hold-trigger-on-release; // delay positional check until key-release
}; };
}; };
@ -84,24 +101,12 @@
bindings = <&kp EQUAL>; bindings = <&kp EQUAL>;
layers = <BASE>; layers = <BASE>;
}; };
combo_l_ctrl {
timeout-ms = <25>;
key-positions = <LM3 LM2>;
bindings = <&sk LCTRL>;
layers = <BASE>;
};
combo_tab { combo_tab {
timeout-ms = <25>; timeout-ms = <25>;
key-positions = <LM2 LM1>; key-positions = <LM2 LM1>;
bindings = <&lt MODS TAB>; bindings = <&lt MODS TAB>;
layers = <BASE>; layers = <BASE>;
}; };
combo_l_cmd {
timeout-ms = <25>;
key-positions = <LM4 LM3>;
bindings = <&sk LCMD>;
layers = <BASE>;
};
combo_backspace { combo_backspace {
@ -110,38 +115,12 @@
bindings = <&kp BACKSPACE>; bindings = <&kp BACKSPACE>;
layers = <BASE>; layers = <BASE>;
}; };
combo_r_ctrl {
timeout-ms = <25>;
key-positions = <RM2 RM3>;
bindings = <&sk LCTRL>;
layers = <BASE>;
};
combo_enter { combo_enter {
timeout-ms = <25>; timeout-ms = <25>;
key-positions = <RM1 RM2>; key-positions = <RM1 RM2>;
bindings = <&kp ENTER>; bindings = <&kp ENTER>;
layers = <BASE>; layers = <BASE>;
}; };
combo_r_cmd {
timeout-ms = <25>;
key-positions = <RM3 RM4>;
bindings = <&sk LCMD>;
layers = <BASE>;
};
combo_l_alt {
timeout-ms = <80>;
key-positions = <LT2 LM3>;
bindings = <&sk LALT>;
layers = <BASE>;
};
combo_r_alt {
timeout-ms = <80>;
key-positions = <RT2 RM3>;
bindings = <&sk LALT>;
layers = <BASE>;
};
combo_minus { combo_minus {
timeout-ms = <40>; timeout-ms = <40>;
@ -179,7 +158,7 @@
&kp Q &kp W &kp F &kp P &kp B &kp J &kp L &kp U &kp Y &kp SQT &kp Q &kp W &kp F &kp P &kp B &kp J &kp L &kp U &kp Y &kp SQT
//├──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┤ //├──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┤
//│ A │ R │ S │ T │ G │ │ M │ N │ E │ I │ O │ //│ A │ R │ S │ T │ G │ │ M │ N │ E │ I │ O │
&kp A &kp R &kp S &kp T &kp G &kp M &kp N &kp E &kp I &kp O &kp A HRML(R, S, T) &kp G &kp M HRMR(N, E, I) &kp O
//├──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┤ //├──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┤
//│ Z │ X │ C │ D │ V │ │ K │ H │ , < │ . > │ / ? │ //│ Z │ X │ C │ D │ V │ │ K │ H │ , < │ . > │ / ? │
&kp Z &kp X &kp C &kp D &kp V &kp K &kp H &kp COMMA &kp DOT &kp FSLH &kp Z &kp X &kp C &kp D &kp V &kp K &kp H &kp COMMA &kp DOT &kp FSLH
@ -213,7 +192,7 @@
&kp ESC &kp C_MUTE &kp VOL_DN &kp VOL_UP &none &caps_word &kp INS &none &none &kp DEL &kp ESC &kp C_MUTE &kp VOL_DN &kp VOL_UP &none &caps_word &kp INS &none &none &kp DEL
//├──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┤ //├──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┤
//│ SHIFT │ CMD │ ALT │ CTRL │ TAB │ │ BACKSPACE│ LEFT │ DOWN │ UP │ RIGHT │ //│ SHIFT │ CMD │ ALT │ CTRL │ TAB │ │ BACKSPACE│ LEFT │ DOWN │ UP │ RIGHT │
&sk LSHFT &sk LCMD &kp LALT &kp LCTRL &kp TAB &kp BSPC &kp LEFT &kp DOWN &kp UP &kp RIGHT &sk LSHFT &sk LCMD &sk LALT &sk LCTRL &kp TAB &kp BSPC &kp LEFT &kp DOWN &kp UP &kp RIGHT
//├──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┤ //├──────────┼──────────┼──────────┼──────────┼──────────┤ ├──────────┼──────────┼──────────┼──────────┼──────────┤
//│ │ PLAY │ PREVIOUS │ NEXT │ │ │ ENTER │ HOME │ PG DOWN │ PG UP │ END │ //│ │ PLAY │ PREVIOUS │ NEXT │ │ │ ENTER │ HOME │ PG DOWN │ PG UP │ END │
&none &kp C_PP &kp C_PREV &kp C_NEXT &none &kp ENTER &kp HOME &kp PG_DN &kp PG_UP &kp END &none &kp C_PP &kp C_PREV &kp C_NEXT &none &kp ENTER &kp HOME &kp PG_DN &kp PG_UP &kp END

View file

@ -52,3 +52,7 @@
#define RH0 32 // right thumb keys #define RH0 32 // right thumb keys
#define RH1 33 #define RH1 33
#define KEYS_L LT0 LT1 LT2 LT3 LT4 LM0 LM1 LM2 LM3 LM4 LB0 LB1 LB2 LB3 LB4 // left-hand keys
#define KEYS_R RT0 RT1 RT2 RT3 RT4 RM0 RM1 RM2 RM3 RM4 RB0 RB1 RB2 RB3 RB4 // right-hand keys
#define THUMBS LH1 LH0 RH0 RH1

View file

@ -366,10 +366,4 @@ parse_config:
NON_US_HASH: '#' NON_US_HASH: '#'
NUHS: '#' NUHS: '#'
TILDE2: '~' TILDE2: '~'
zmk_combos: zmk_combos: {}
combo_l_alt:
align: top
offset: 0.5
combo_r_alt:
align: top
offset: 0.5