feat(test): add tests for momentary layers
This commit is contained in:
parent
5b21f15a0a
commit
5f56266a69
7 changed files with 56 additions and 0 deletions
28
app/tests/momentary-layer/behavior_keymap.dtsi
Normal file
28
app/tests/momentary-layer/behavior_keymap.dtsi
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
#include <dt-bindings/zmk/keys.h>
|
||||||
|
#include <behaviors.dtsi>
|
||||||
|
#include <dt-bindings/zmk/kscan-mock.h>
|
||||||
|
|
||||||
|
/ {
|
||||||
|
keymap {
|
||||||
|
compatible = "zmk,keymap";
|
||||||
|
label ="Default keymap";
|
||||||
|
|
||||||
|
default_layer {
|
||||||
|
bindings = <
|
||||||
|
&kp B &mo 1
|
||||||
|
&kp D &kp G>;
|
||||||
|
};
|
||||||
|
|
||||||
|
lower_layer {
|
||||||
|
bindings = <
|
||||||
|
&cp M_NEXT &trans
|
||||||
|
&kp L &kp J>;
|
||||||
|
};
|
||||||
|
|
||||||
|
raise_layer {
|
||||||
|
bindings = <
|
||||||
|
&kp W &kp U
|
||||||
|
&kp X &kp M>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
|
@ -0,0 +1,2 @@
|
||||||
|
s/.*hid_listener_keycode/kp/p
|
||||||
|
s/.*mo_keymap_binding/mo/p
|
|
@ -0,0 +1,4 @@
|
||||||
|
kp_pressed: usage_page 0x07 keycode 0x05
|
||||||
|
mo_pressed: position 1 layer 1
|
||||||
|
kp_released: usage_page 0x07 keycode 0x05
|
||||||
|
mo_released: position 1 layer 1
|
|
@ -0,0 +1,8 @@
|
||||||
|
#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,0) ZMK_MOCK_PRESS(0,1,100) ZMK_MOCK_RELEASE(0,0,200) ZMK_MOCK_RELEASE(0,1,300)>;
|
||||||
|
};
|
2
app/tests/momentary-layer/normal/events.patterns
Normal file
2
app/tests/momentary-layer/normal/events.patterns
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
s/.*hid_listener_keycode/kp/p
|
||||||
|
s/.*mo_keymap_binding/mo/p
|
4
app/tests/momentary-layer/normal/keycode_events.snapshot
Normal file
4
app/tests/momentary-layer/normal/keycode_events.snapshot
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
mo_pressed: position 1 layer 1
|
||||||
|
kp_pressed: usage_page 0x0c keycode 0xb5
|
||||||
|
kp_released: usage_page 0x0c keycode 0xb5
|
||||||
|
mo_released: position 1 layer 1
|
8
app/tests/momentary-layer/normal/native_posix.keymap
Normal file
8
app/tests/momentary-layer/normal/native_posix.keymap
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
#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,1,0) ZMK_MOCK_PRESS(0,0,100) ZMK_MOCK_RELEASE(0,0,200) ZMK_MOCK_RELEASE(0,1,300)>;
|
||||||
|
};
|
Loading…
Reference in a new issue