From 154b4ab318310c45238ae36da04f851bdb4d5b38 Mon Sep 17 00:00:00 2001 From: Sviatoslav Bulbakha Date: Fri, 20 Dec 2024 18:14:59 +0400 Subject: [PATCH] Add one more failing test --- .../combo/other-key-release-2/events.patterns | 1 + .../keycode_events.snapshot | 4 ++ .../native_posix_64.keymap | 57 +++++++++++++++++++ .../keycode_events.snapshot | 2 +- 4 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 app/tests/combo/other-key-release-2/events.patterns create mode 100644 app/tests/combo/other-key-release-2/keycode_events.snapshot create mode 100644 app/tests/combo/other-key-release-2/native_posix_64.keymap diff --git a/app/tests/combo/other-key-release-2/events.patterns b/app/tests/combo/other-key-release-2/events.patterns new file mode 100644 index 000000000000..b1342af4d971 --- /dev/null +++ b/app/tests/combo/other-key-release-2/events.patterns @@ -0,0 +1 @@ +s/.*hid_listener_keycode_//p diff --git a/app/tests/combo/other-key-release-2/keycode_events.snapshot b/app/tests/combo/other-key-release-2/keycode_events.snapshot new file mode 100644 index 000000000000..5e451bc8d7bd --- /dev/null +++ b/app/tests/combo/other-key-release-2/keycode_events.snapshot @@ -0,0 +1,4 @@ +pressed: usage_page 0x07 keycode 0x05 implicit_mods 0x00 explicit_mods 0x00 +released: usage_page 0x07 keycode 0x05 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 diff --git a/app/tests/combo/other-key-release-2/native_posix_64.keymap b/app/tests/combo/other-key-release-2/native_posix_64.keymap new file mode 100644 index 000000000000..bc6d308d5794 --- /dev/null +++ b/app/tests/combo/other-key-release-2/native_posix_64.keymap @@ -0,0 +1,57 @@ +#include +#include +#include + +/* +Combo on positions 01 and 23. + +- press 2 and 3 +- press 0 +- release 2 +- press 1 +- release the rest + +Both combos should actuate. +*/ + +/ { + combos { + compatible = "zmk,combos"; + + combo_a { + timeout-ms = <50>; + key-positions = <0 1>; + bindings = <&kp A>; + }; + + combo_b { + timeout-ms = <50>; + key-positions = <2 3>; + bindings = <&kp B>; + }; + }; + + keymap { + compatible = "zmk,keymap"; + + default_layer { + bindings = < + &kp N0 &kp N1 + &kp N2 &kp N3 + >; + }; + }; +}; + +&kscan { + events = < + ZMK_MOCK_PRESS(1,0,10) + ZMK_MOCK_PRESS(1,1,10) + ZMK_MOCK_PRESS(0,0,10) + ZMK_MOCK_RELEASE(1,0,10) + ZMK_MOCK_PRESS(0,1,10) + ZMK_MOCK_RELEASE(1,1,0) + ZMK_MOCK_RELEASE(0,0,0) + ZMK_MOCK_RELEASE(0,1,0) + >; +}; diff --git a/app/tests/combo/overlapping-combos-5/keycode_events.snapshot b/app/tests/combo/overlapping-combos-5/keycode_events.snapshot index bb47d85203c5..b809163ddca7 100644 --- a/app/tests/combo/overlapping-combos-5/keycode_events.snapshot +++ b/app/tests/combo/overlapping-combos-5/keycode_events.snapshot @@ -1,4 +1,4 @@ pressed: usage_page 0x07 keycode 0x04 implicit_mods 0x00 explicit_mods 0x00 -pressed: usage_page 0x07 keycode 0x05 implicit_mods 0x00 explicit_mods 0x00 released: usage_page 0x07 keycode 0x04 implicit_mods 0x00 explicit_mods 0x00 +pressed: usage_page 0x07 keycode 0x05 implicit_mods 0x00 explicit_mods 0x00 released: usage_page 0x07 keycode 0x05 implicit_mods 0x00 explicit_mods 0x00