test(behavior): Add alt-tab test and modded alpha test for toggle key
Uses multiple toggles of modifier keys overlapping each other.
This commit is contained in:
parent
0977be622a
commit
6dc436cb23
10 changed files with 148 additions and 0 deletions
1
app/tests/keytoggle/kt-alt-tab/events.patterns
Normal file
1
app/tests/keytoggle/kt-alt-tab/events.patterns
Normal file
|
@ -0,0 +1 @@
|
||||||
|
s/.*\(hid_listener_keycode_\|hid_implicit_modifiers_\)//p
|
28
app/tests/keytoggle/kt-alt-tab/keycode_events.snapshot
Normal file
28
app/tests/keytoggle/kt-alt-tab/keycode_events.snapshot
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
pressed: usage_page 0x07 keycode 0xE2 implicit_mods 0x00 explicit_mods 0x00
|
||||||
|
press: Modifiers set to 0x04
|
||||||
|
pressed: usage_page 0x07 keycode 0x2B implicit_mods 0x00 explicit_mods 0x00
|
||||||
|
press: Modifiers set to 0x04
|
||||||
|
released: usage_page 0x07 keycode 0x2B implicit_mods 0x00 explicit_mods 0x00
|
||||||
|
release: Modifiers set to 0x04
|
||||||
|
pressed: usage_page 0x07 keycode 0x2B implicit_mods 0x00 explicit_mods 0x00
|
||||||
|
press: Modifiers set to 0x04
|
||||||
|
released: usage_page 0x07 keycode 0x2B implicit_mods 0x00 explicit_mods 0x00
|
||||||
|
release: Modifiers set to 0x04
|
||||||
|
pressed: usage_page 0x07 keycode 0xE1 implicit_mods 0x00 explicit_mods 0x00
|
||||||
|
press: Modifiers set to 0x06
|
||||||
|
pressed: usage_page 0x07 keycode 0x2B implicit_mods 0x00 explicit_mods 0x00
|
||||||
|
press: Modifiers set to 0x06
|
||||||
|
released: usage_page 0x07 keycode 0x2B implicit_mods 0x00 explicit_mods 0x00
|
||||||
|
release: Modifiers set to 0x06
|
||||||
|
released: usage_page 0x07 keycode 0xE2 implicit_mods 0x00 explicit_mods 0x00
|
||||||
|
release: Modifiers set to 0x02
|
||||||
|
pressed: usage_page 0x07 keycode 0x04 implicit_mods 0x00 explicit_mods 0x00
|
||||||
|
press: Modifiers set to 0x02
|
||||||
|
released: usage_page 0x07 keycode 0x04 implicit_mods 0x00 explicit_mods 0x00
|
||||||
|
release: Modifiers set to 0x02
|
||||||
|
released: usage_page 0x07 keycode 0xE1 implicit_mods 0x00 explicit_mods 0x00
|
||||||
|
release: Modifiers set to 0x00
|
||||||
|
pressed: usage_page 0x07 keycode 0x04 implicit_mods 0x00 explicit_mods 0x00
|
||||||
|
press: Modifiers set to 0x00
|
||||||
|
released: usage_page 0x07 keycode 0x04 implicit_mods 0x00 explicit_mods 0x00
|
||||||
|
release: Modifiers set to 0x00
|
48
app/tests/keytoggle/kt-alt-tab/native_posix_64.keymap
Normal file
48
app/tests/keytoggle/kt-alt-tab/native_posix_64.keymap
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
#include <dt-bindings/zmk/keys.h>
|
||||||
|
#include <behaviors.dtsi>
|
||||||
|
#include <dt-bindings/zmk/kscan_mock.h>
|
||||||
|
|
||||||
|
&kscan {
|
||||||
|
events = <
|
||||||
|
/* Toggle LALT on */
|
||||||
|
ZMK_MOCK_PRESS(0,0,10)
|
||||||
|
ZMK_MOCK_RELEASE(0,0,10)
|
||||||
|
/* Tap TAB twice */
|
||||||
|
ZMK_MOCK_PRESS(0,1,10)
|
||||||
|
ZMK_MOCK_RELEASE(0,1,10)
|
||||||
|
ZMK_MOCK_PRESS(0,1,10)
|
||||||
|
ZMK_MOCK_RELEASE(0,1,10)
|
||||||
|
/* Toggle LSHFT on */
|
||||||
|
ZMK_MOCK_PRESS(1,0,10)
|
||||||
|
ZMK_MOCK_RELEASE(1,0,10)
|
||||||
|
/* Tap TAB once */
|
||||||
|
ZMK_MOCK_PRESS(0,1,10)
|
||||||
|
ZMK_MOCK_RELEASE(0,1,10)
|
||||||
|
/* Toggle LALT off */
|
||||||
|
ZMK_MOCK_PRESS(0,0,10)
|
||||||
|
ZMK_MOCK_RELEASE(0,0,10)
|
||||||
|
/* Tap A */
|
||||||
|
ZMK_MOCK_PRESS(1,1,10)
|
||||||
|
ZMK_MOCK_RELEASE(1,1,10)
|
||||||
|
/* Toggle LSHFT off */
|
||||||
|
ZMK_MOCK_PRESS(1,0,10)
|
||||||
|
ZMK_MOCK_RELEASE(1,0,10)
|
||||||
|
/* Tap A */
|
||||||
|
ZMK_MOCK_PRESS(1,1,10)
|
||||||
|
ZMK_MOCK_RELEASE(1,1,10)
|
||||||
|
>;
|
||||||
|
};
|
||||||
|
|
||||||
|
/ {
|
||||||
|
keymap {
|
||||||
|
compatible = "zmk,keymap";
|
||||||
|
label ="Default keymap";
|
||||||
|
|
||||||
|
default_layer {
|
||||||
|
bindings = <
|
||||||
|
&kt LALT &kp TAB
|
||||||
|
&kt LSHFT &kp A
|
||||||
|
>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
1
app/tests/keytoggle/kt-modded-alpha/events.patterns
Normal file
1
app/tests/keytoggle/kt-modded-alpha/events.patterns
Normal file
|
@ -0,0 +1 @@
|
||||||
|
s/.*\(hid_listener_keycode_\|hid_implicit_modifiers_\)//p
|
12
app/tests/keytoggle/kt-modded-alpha/keycode_events.snapshot
Normal file
12
app/tests/keytoggle/kt-modded-alpha/keycode_events.snapshot
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
pressed: usage_page 0x07 keycode 0x04 implicit_mods 0x02 explicit_mods 0x00
|
||||||
|
press: Modifiers set to 0x02
|
||||||
|
released: usage_page 0x07 keycode 0x04 implicit_mods 0x02 explicit_mods 0x00
|
||||||
|
release: Modifiers set to 0x00
|
||||||
|
pressed: usage_page 0x07 keycode 0x04 implicit_mods 0x00 explicit_mods 0x00
|
||||||
|
press: Modifiers set to 0x00
|
||||||
|
released: usage_page 0x07 keycode 0x04 implicit_mods 0x02 explicit_mods 0x00
|
||||||
|
release: Modifiers set to 0x00
|
||||||
|
pressed: usage_page 0x07 keycode 0x04 implicit_mods 0x02 explicit_mods 0x00
|
||||||
|
press: Modifiers set to 0x02
|
||||||
|
released: usage_page 0x07 keycode 0x04 implicit_mods 0x00 explicit_mods 0x00
|
||||||
|
release: Modifiers set to 0x00
|
38
app/tests/keytoggle/kt-modded-alpha/native_posix_64.keymap
Normal file
38
app/tests/keytoggle/kt-modded-alpha/native_posix_64.keymap
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
#include <dt-bindings/zmk/keys.h>
|
||||||
|
#include <behaviors.dtsi>
|
||||||
|
#include <dt-bindings/zmk/kscan_mock.h>
|
||||||
|
|
||||||
|
&kscan {
|
||||||
|
events = <
|
||||||
|
/* Toggle LS(A) on */
|
||||||
|
ZMK_MOCK_PRESS(0,0,10)
|
||||||
|
ZMK_MOCK_RELEASE(0,0,10)
|
||||||
|
/* Toggle LS(A) off */
|
||||||
|
ZMK_MOCK_PRESS(0,0,10)
|
||||||
|
ZMK_MOCK_RELEASE(0,0,10)
|
||||||
|
/* Press A */
|
||||||
|
ZMK_MOCK_PRESS(1,0,10)
|
||||||
|
/* Toggle LS(A) on */
|
||||||
|
ZMK_MOCK_PRESS(0,0,10)
|
||||||
|
ZMK_MOCK_RELEASE(0,0,10)
|
||||||
|
/* Toggle LS(A) off */
|
||||||
|
ZMK_MOCK_PRESS(0,0,10)
|
||||||
|
ZMK_MOCK_RELEASE(0,0,10)
|
||||||
|
/* Release A */
|
||||||
|
ZMK_MOCK_RELEASE(1,0,10)
|
||||||
|
>;
|
||||||
|
};
|
||||||
|
|
||||||
|
/ {
|
||||||
|
keymap {
|
||||||
|
compatible = "zmk,keymap";
|
||||||
|
label ="Default keymap";
|
||||||
|
|
||||||
|
default_layer {
|
||||||
|
bindings = <
|
||||||
|
&kt LS(A) &trans
|
||||||
|
&kp A &trans
|
||||||
|
>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
|
@ -0,0 +1 @@
|
||||||
|
s/.*hid_listener_keycode_//p
|
|
@ -0,0 +1,2 @@
|
||||||
|
pressed: usage_page 0x07 keycode 0x05 implicit_mods 0x00 explicit_mods 0x00
|
||||||
|
released: usage_page 0x07 keycode 0x05 implicit_mods 0x00 explicit_mods 0x00
|
|
@ -0,0 +1,7 @@
|
||||||
|
CONFIG_GPIO=n
|
||||||
|
CONFIG_LOG=y
|
||||||
|
CONFIG_LOG_BACKEND_SHOW_COLOR=n
|
||||||
|
CONFIG_ZMK_LOG_LEVEL_DBG=y
|
||||||
|
CONFIG_DEBUG=y
|
||||||
|
CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000
|
||||||
|
CONFIG_ZMK_HID_REPORT_TYPE_NKRO=y
|
|
@ -0,0 +1,10 @@
|
||||||
|
#include "../behavior_keymap.dtsi"
|
||||||
|
|
||||||
|
&kscan {
|
||||||
|
events = <
|
||||||
|
ZMK_MOCK_PRESS(0,0,10)
|
||||||
|
ZMK_MOCK_RELEASE(0,0,10)
|
||||||
|
ZMK_MOCK_PRESS(0,0,10)
|
||||||
|
ZMK_MOCK_RELEASE(0,0,10)
|
||||||
|
>;
|
||||||
|
};
|
Loading…
Add table
Reference in a new issue