zmk
zmk copied to clipboard
fix: `keydown` and `keyup` event occurs simultaneously when pressing `&kp` while holding `&mo`
Hi!
Let's say I have a keymap like this.
#define LAYER_B 1
/ {
behaviors {
hlt: hold_preferred_lt {
compatible = "zmk,behavior-hold-tap";
label = "hold_preferred_lt";
#binding-cells = <2>;
tapping-term-ms = <160>;
flavor = "hold-preferred";
bindings = <&mo>, <&kp>;
};
};
keymap {
compatible = "zmk,keymap";
a {
&kp A &hlt LAYER_B C
};
b {
&kp LCMD &trans
};
};
};
There're two physical keys. When I hold the second key,
Steps for what I expected
- Layer A is active by default.
- Keep Holding the second key.
-
&mo LAYER_B
takes effect. - Hold the first key.
-
keydown
event forLCMD
occurs. - Stop holding the first key.
-
keyup
event forLCMD
occurs. - Stop holding the second key.
- Layer A is activated again.
Steps for what actually happens
- Layer A is active by default.
- Keep Holding the second key.
-
&mo LAYER_B
takes effect. - Hold the first key.
- No event occurs.
- Stop holding the first key.
-
keydown
andkeyup
event forLCMD
occurs. - Stop holding the second key.
- Layer A is activated again.
Step 4 and 6 are different from what I expected. Is this an intended behavior?