Bug: Layer-tap from higher-number to lower fails

This commit is contained in:
Hunter Haugen 2022-11-20 08:51:51 -08:00
parent c7fdce863a
commit cc9035693b
No known key found for this signature in database
GPG key ID: EF99694AA599DDAD
3 changed files with 85 additions and 0 deletions

View file

@ -0,0 +1,2 @@
s/.*hid_listener_keycode/kp/p
s/.*mo_keymap_binding/mo/p

View file

@ -0,0 +1,12 @@
mo_pressed: position 1 layer 2
kp_pressed: usage_page 0x07 keycode 0x1F implicit_mods 0x00 explicit_mods 0x00
kp_released: usage_page 0x07 keycode 0x1F implicit_mods 0x00 explicit_mods 0x00
mo_released: position 1 layer 2
mo_pressed: position 2 layer 2
kp_pressed: usage_page 0x07 keycode 0x1F implicit_mods 0x00 explicit_mods 0x00
kp_released: usage_page 0x07 keycode 0x1F implicit_mods 0x00 explicit_mods 0x00
mo_released: position 2 layer 2
mo_pressed: position 2 layer 2
kp_pressed: usage_page 0x07 keycode 0x1F implicit_mods 0x00 explicit_mods 0x00
kp_released: usage_page 0x07 keycode 0x1F implicit_mods 0x00 explicit_mods 0x00
mo_released: position 2 layer 2

View file

@ -0,0 +1,71 @@
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/kscan_mock.h>
&lt {
flavor = "balanced";
};
/ {
keymap {
compatible = "zmk,keymap";
default_layer {
bindings = <
&kp N0 &lt 2 N0
&to 1 &to 3
>;
};
layer_1 {
bindings = <
&kp N1 &none
&lt 2 N1 &to 0
>;
};
layer_2 {
bindings = <
&kp N2 &none
&trans &trans
>;
};
layer_3 {
bindings = <
&kp N3 &none
&lt 2 N3 &to 0
>;
};
};
};
&kscan {
events = <
// LT 0->2 and get 2
ZMK_MOCK_PRESS(0,1,10)
ZMK_MOCK_PRESS(0,0,10)
ZMK_MOCK_RELEASE(0,0,10)
ZMK_MOCK_RELEASE(0,1,10)
// TO 1
ZMK_MOCK_PRESS(1,0,10)
ZMK_MOCK_RELEASE(1,0,10)
// LT 1->2 and get 2
ZMK_MOCK_PRESS(1,0,10)
ZMK_MOCK_PRESS(0,0,10)
ZMK_MOCK_RELEASE(0,0,10)
ZMK_MOCK_RELEASE(1,0,10)
// TO 0
ZMK_MOCK_PRESS(1,1,10)
ZMK_MOCK_RELEASE(1,1,10)
// TO 3
ZMK_MOCK_PRESS(1,1,10)
ZMK_MOCK_RELEASE(1,1,10)
// LT 3->2 and get 2
ZMK_MOCK_PRESS(1,0,10)
ZMK_MOCK_PRESS(0,0,10)
ZMK_MOCK_RELEASE(0,0,10)
ZMK_MOCK_RELEASE(1,0,10)
>;
};