summaryrefslogtreecommitdiff
path: root/app/tests/key-repeat/press-and-release-after-key-usage
diff options
context:
space:
mode:
authorPeter Johanson <peter@peterjohanson.com>2021-11-29 04:26:22 +0000
committerPete Johanson <peter@peterjohanson.com>2022-01-30 22:47:34 -0500
commit70bb7c93349344e0990f12282abfcd8d00ba7208 (patch)
treeeeb47ee39ec4a887ef6d1edf809b88709e6269bb /app/tests/key-repeat/press-and-release-after-key-usage
parentac3c3170bd70f5186544495cb5ced7bfbf3f6764 (diff)
feat(behaviors): `&key_repeat` behavior + tests.
* Add new `&key_repeat` behavior that captures and re-sends the most recently triggered keycode. Closes: #853
Diffstat (limited to 'app/tests/key-repeat/press-and-release-after-key-usage')
-rw-r--r--app/tests/key-repeat/press-and-release-after-key-usage/events.patterns2
-rw-r--r--app/tests/key-repeat/press-and-release-after-key-usage/keycode_events.snapshot8
-rw-r--r--app/tests/key-repeat/press-and-release-after-key-usage/native_posix.keymap13
3 files changed, 23 insertions, 0 deletions
diff --git a/app/tests/key-repeat/press-and-release-after-key-usage/events.patterns b/app/tests/key-repeat/press-and-release-after-key-usage/events.patterns
new file mode 100644
index 0000000..7947192
--- /dev/null
+++ b/app/tests/key-repeat/press-and-release-after-key-usage/events.patterns
@@ -0,0 +1,2 @@
+s/.*hid_listener_keycode_//p
+s/.*hid_implicit_modifiers_//p \ No newline at end of file
diff --git a/app/tests/key-repeat/press-and-release-after-key-usage/keycode_events.snapshot b/app/tests/key-repeat/press-and-release-after-key-usage/keycode_events.snapshot
new file mode 100644
index 0000000..d568d37
--- /dev/null
+++ b/app/tests/key-repeat/press-and-release-after-key-usage/keycode_events.snapshot
@@ -0,0 +1,8 @@
+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
+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
diff --git a/app/tests/key-repeat/press-and-release-after-key-usage/native_posix.keymap b/app/tests/key-repeat/press-and-release-after-key-usage/native_posix.keymap
new file mode 100644
index 0000000..98c8f6f
--- /dev/null
+++ b/app/tests/key-repeat/press-and-release-after-key-usage/native_posix.keymap
@@ -0,0 +1,13 @@
+#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,10)
+ ZMK_MOCK_RELEASE(0,1,10)
+ ZMK_MOCK_PRESS(0,0,10)
+ ZMK_MOCK_RELEASE(0,0,10)
+ >;
+}; \ No newline at end of file