forked from kofal.net/zmk
fix(behaviors): Make multiple sticky keys work on same key position (#2758)
test(behaviors): Add same position sticky key tests fix(behaviors): Make multiple sticky keys work on same key position refactor(behaviors): Remove unused param2 in sticky keys
This commit is contained in:
@@ -0,0 +1 @@
|
||||
s/.*hid_listener_keycode_//p
|
||||
@@ -0,0 +1,6 @@
|
||||
pressed: usage_page 0x07 keycode 0xE0 implicit_mods 0x00 explicit_mods 0x00
|
||||
pressed: usage_page 0x07 keycode 0xE1 implicit_mods 0x00 explicit_mods 0x00
|
||||
pressed: usage_page 0x07 keycode 0x04 implicit_mods 0x00 explicit_mods 0x00
|
||||
released: usage_page 0x07 keycode 0x04 implicit_mods 0x00 explicit_mods 0x00
|
||||
released: usage_page 0x07 keycode 0xE0 implicit_mods 0x00 explicit_mods 0x00
|
||||
released: usage_page 0x07 keycode 0xE1 implicit_mods 0x00 explicit_mods 0x00
|
||||
@@ -0,0 +1,39 @@
|
||||
#include <dt-bindings/zmk/keys.h>
|
||||
#include <behaviors.dtsi>
|
||||
#include <dt-bindings/zmk/kscan_mock.h>
|
||||
|
||||
/ {
|
||||
keymap {
|
||||
compatible = "zmk,keymap";
|
||||
|
||||
default_layer {
|
||||
bindings = <
|
||||
&sk LEFT_CONTROL &mo 1
|
||||
&kp A &kp B>;
|
||||
};
|
||||
|
||||
lower_layer {
|
||||
bindings = <
|
||||
&sk LEFT_SHIFT &kp X
|
||||
&kp Y &kp Z>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&kscan {
|
||||
events = <
|
||||
/* tap sk LEFT_CONTROL */
|
||||
ZMK_MOCK_PRESS(0,0,10)
|
||||
ZMK_MOCK_RELEASE(0,0,10)
|
||||
/* switch to lower layer */
|
||||
ZMK_MOCK_PRESS(0,1,10)
|
||||
/* tap sk LEFT_SHIFT */
|
||||
ZMK_MOCK_PRESS(0,0,10)
|
||||
ZMK_MOCK_RELEASE(0,0,10)
|
||||
/* deactivate lower layer */
|
||||
ZMK_MOCK_RELEASE(0,1,10)
|
||||
/* tap A */
|
||||
ZMK_MOCK_PRESS(1,0,10)
|
||||
ZMK_MOCK_RELEASE(1,0,10)
|
||||
>;
|
||||
};
|
||||
Reference in New Issue
Block a user