summaryrefslogtreecommitdiff
path: root/app/tests/combo/combos-and-holdtaps-2
diff options
context:
space:
mode:
Diffstat (limited to 'app/tests/combo/combos-and-holdtaps-2')
-rw-r--r--app/tests/combo/combos-and-holdtaps-2/events.patterns2
-rw-r--r--app/tests/combo/combos-and-holdtaps-2/keycode_events.snapshot2
-rw-r--r--app/tests/combo/combos-and-holdtaps-2/native_posix.keymap45
3 files changed, 49 insertions, 0 deletions
diff --git a/app/tests/combo/combos-and-holdtaps-2/events.patterns b/app/tests/combo/combos-and-holdtaps-2/events.patterns
new file mode 100644
index 0000000..b90d786
--- /dev/null
+++ b/app/tests/combo/combos-and-holdtaps-2/events.patterns
@@ -0,0 +1,2 @@
+s/.*hid_listener_keycode_//p
+s/.*combo//p \ No newline at end of file
diff --git a/app/tests/combo/combos-and-holdtaps-2/keycode_events.snapshot b/app/tests/combo/combos-and-holdtaps-2/keycode_events.snapshot
new file mode 100644
index 0000000..a650880
--- /dev/null
+++ b/app/tests/combo/combos-and-holdtaps-2/keycode_events.snapshot
@@ -0,0 +1,2 @@
+pressed: usage_page 0x07 keycode 0xe0 mods 0x00
+pressed: usage_page 0x07 keycode 0xe4 mods 0x00
diff --git a/app/tests/combo/combos-and-holdtaps-2/native_posix.keymap b/app/tests/combo/combos-and-holdtaps-2/native_posix.keymap
new file mode 100644
index 0000000..f8dbe45
--- /dev/null
+++ b/app/tests/combo/combos-and-holdtaps-2/native_posix.keymap
@@ -0,0 +1,45 @@
+#include <dt-bindings/zmk/keys.h>
+#include <behaviors.dtsi>
+#include <dt-bindings/zmk/kscan-mock.h>
+
+&mt {
+ flavor = "hold-preferred";
+};
+
+/* This test verifies that hold-tap keys can observe
+ * events which were released from combos.
+ */
+/ {
+ combos {
+ compatible = "zmk,combos";
+ combo_one {
+ timeout-ms = <100>;
+ key-positions = <0 2>;
+ bindings = <&kp Y>;
+ };
+ combo_two {
+ timeout-ms = <100>;
+ key-positions = <1 3>;
+ bindings = <&kp Z>;
+ };
+ };
+
+ keymap {
+ compatible = "zmk,keymap";
+ label ="Default keymap";
+
+ default_layer {
+ bindings = <
+ &mt LEFT_CONTROL A &mt RIGHT_CONTROL B
+ &none &none
+ >;
+ };
+ };
+};
+
+&kscan {
+ events = <
+ ZMK_MOCK_PRESS(0,0,0)
+ ZMK_MOCK_PRESS(0,1,300)
+ >;
+}; \ No newline at end of file