forked from kofal.net/zmk
feat: Allow layer behaviors to "lock" layers on (#2717)
* refactor(core)!: Allow layer behaviors to "lock" layers on Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com> * docs: Added documentation note on locking layers Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com> --------- Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
This commit is contained in:
3
app/tests/toggle-layer/locking/events.patterns
Normal file
3
app/tests/toggle-layer/locking/events.patterns
Normal file
@@ -0,0 +1,3 @@
|
||||
s/.*hid_listener_keycode/kp/p
|
||||
s/.*tog_keymap_binding/tog/p
|
||||
s/.*mo_keymap_binding/mo/p
|
||||
16
app/tests/toggle-layer/locking/keycode_events.snapshot
Normal file
16
app/tests/toggle-layer/locking/keycode_events.snapshot
Normal file
@@ -0,0 +1,16 @@
|
||||
kp_pressed: usage_page 0x07 keycode 0x05 implicit_mods 0x00 explicit_mods 0x00
|
||||
kp_released: usage_page 0x07 keycode 0x05 implicit_mods 0x00 explicit_mods 0x00
|
||||
mo_pressed: position 2 layer 2
|
||||
tog_pressed: position 1 layer 2
|
||||
tog_released: position 1 layer 2
|
||||
mo_released: position 2 layer 2
|
||||
kp_pressed: usage_page 0x07 keycode 0x1A implicit_mods 0x00 explicit_mods 0x00
|
||||
kp_released: usage_page 0x07 keycode 0x1A implicit_mods 0x00 explicit_mods 0x00
|
||||
mo_pressed: position 3 layer 2
|
||||
mo_released: position 3 layer 2
|
||||
kp_pressed: usage_page 0x07 keycode 0x1A implicit_mods 0x00 explicit_mods 0x00
|
||||
kp_released: usage_page 0x07 keycode 0x1A implicit_mods 0x00 explicit_mods 0x00
|
||||
tog_pressed: position 1 layer 2
|
||||
tog_released: position 1 layer 2
|
||||
kp_pressed: usage_page 0x07 keycode 0x05 implicit_mods 0x00 explicit_mods 0x00
|
||||
kp_released: usage_page 0x07 keycode 0x05 implicit_mods 0x00 explicit_mods 0x00
|
||||
25
app/tests/toggle-layer/locking/native_posix_64.keymap
Normal file
25
app/tests/toggle-layer/locking/native_posix_64.keymap
Normal file
@@ -0,0 +1,25 @@
|
||||
#include <dt-bindings/zmk/keys.h>
|
||||
#include <behaviors.dtsi>
|
||||
#include <dt-bindings/zmk/kscan_mock.h>
|
||||
#include "../behavior_keymap.dtsi"
|
||||
|
||||
&kscan {
|
||||
events = <
|
||||
ZMK_MOCK_PRESS(0,0,10)
|
||||
ZMK_MOCK_RELEASE(0,0,10)
|
||||
ZMK_MOCK_PRESS(1,0,10)
|
||||
ZMK_MOCK_PRESS(0,1,10)
|
||||
ZMK_MOCK_RELEASE(0,1,10)
|
||||
ZMK_MOCK_RELEASE(1,0,10)
|
||||
ZMK_MOCK_PRESS(0,0,10)
|
||||
ZMK_MOCK_RELEASE(0,0,10)
|
||||
ZMK_MOCK_PRESS(1,1,10)
|
||||
ZMK_MOCK_RELEASE(1,1,10)
|
||||
ZMK_MOCK_PRESS(0,0,10)
|
||||
ZMK_MOCK_RELEASE(0,0,10)
|
||||
ZMK_MOCK_PRESS(0,1,10)
|
||||
ZMK_MOCK_RELEASE(0,1,10)
|
||||
ZMK_MOCK_PRESS(0,0,10)
|
||||
ZMK_MOCK_RELEASE(0,0,10)
|
||||
>;
|
||||
};
|
||||
Reference in New Issue
Block a user