summaryrefslogtreecommitdiff
path: root/app/tests/modifiers/explicit/kp-hyper-dn-a-dn-a-up-hyper-up
diff options
context:
space:
mode:
authorOkke Formsma <okke@formsma.nl>2021-01-22 17:00:19 +0100
committerPete Johanson <peter@peterjohanson.com>2021-01-24 23:30:41 -0500
commit7b7701ae90469b920cd78e2ab7aca0c470140b7a (patch)
treeb4fade597239b5f0df24197faea3413e305a636f /app/tests/modifiers/explicit/kp-hyper-dn-a-dn-a-up-hyper-up
parent0c30b49063c79be2416453f4544795922efad74f (diff)
feature(modifiers): add explicit modifiers
this makes LS(LEFT_CONTROL) work as if shift and control were both pressed explicitly. Previously, the left shift would have been released as soon as another key was pressed. The implicit behavior is useful in case of LS(NUMBER_1) when rolling over to other keys. Also see #361.
Diffstat (limited to 'app/tests/modifiers/explicit/kp-hyper-dn-a-dn-a-up-hyper-up')
-rw-r--r--app/tests/modifiers/explicit/kp-hyper-dn-a-dn-a-up-hyper-up/events.patterns4
-rw-r--r--app/tests/modifiers/explicit/kp-hyper-dn-a-dn-a-up-hyper-up/keycode_events.snapshot28
-rw-r--r--app/tests/modifiers/explicit/kp-hyper-dn-a-dn-a-up-hyper-up/native_posix.keymap28
3 files changed, 60 insertions, 0 deletions
diff --git a/app/tests/modifiers/explicit/kp-hyper-dn-a-dn-a-up-hyper-up/events.patterns b/app/tests/modifiers/explicit/kp-hyper-dn-a-dn-a-up-hyper-up/events.patterns
new file mode 100644
index 0000000..cbf21af
--- /dev/null
+++ b/app/tests/modifiers/explicit/kp-hyper-dn-a-dn-a-up-hyper-up/events.patterns
@@ -0,0 +1,4 @@
+s/.*hid_listener_keycode_//p
+s/.*hid_register_mod/reg/p
+s/.*hid_unregister_mod/unreg/p
+s/.*zmk_hid_.*Modifiers set to /mods: Modifiers set to /p \ No newline at end of file
diff --git a/app/tests/modifiers/explicit/kp-hyper-dn-a-dn-a-up-hyper-up/keycode_events.snapshot b/app/tests/modifiers/explicit/kp-hyper-dn-a-dn-a-up-hyper-up/keycode_events.snapshot
new file mode 100644
index 0000000..e146b9c
--- /dev/null
+++ b/app/tests/modifiers/explicit/kp-hyper-dn-a-dn-a-up-hyper-up/keycode_events.snapshot
@@ -0,0 +1,28 @@
+pressed: usage_page 0x07 keycode 0xe0 implicit_mods 0x00 explicit_mods 0x0e
+reg: Modifier 0 count 1
+reg: Modifiers set to 0x01
+reg: Modifier 1 count 1
+reg: Modifiers set to 0x03
+reg: Modifier 2 count 1
+reg: Modifiers set to 0x07
+reg: Modifier 3 count 1
+reg: Modifiers set to 0x0f
+mods: Modifiers set to 0x0f
+pressed: usage_page 0x07 keycode 0x04 implicit_mods 0x00 explicit_mods 0x00
+mods: Modifiers set to 0x0f
+released: usage_page 0x07 keycode 0x04 implicit_mods 0x00 explicit_mods 0x00
+mods: Modifiers set to 0x0f
+released: usage_page 0x07 keycode 0xe0 implicit_mods 0x00 explicit_mods 0x0e
+unreg: Modifier 0 count: 0
+unreg: Modifier 0 released
+unreg: Modifiers set to 0x0e
+unreg: Modifier 1 count: 0
+unreg: Modifier 1 released
+unreg: Modifiers set to 0x0c
+unreg: Modifier 2 count: 0
+unreg: Modifier 2 released
+unreg: Modifiers set to 0x08
+unreg: Modifier 3 count: 0
+unreg: Modifier 3 released
+unreg: Modifiers set to 0x00
+mods: Modifiers set to 0x00
diff --git a/app/tests/modifiers/explicit/kp-hyper-dn-a-dn-a-up-hyper-up/native_posix.keymap b/app/tests/modifiers/explicit/kp-hyper-dn-a-dn-a-up-hyper-up/native_posix.keymap
new file mode 100644
index 0000000..b814242
--- /dev/null
+++ b/app/tests/modifiers/explicit/kp-hyper-dn-a-dn-a-up-hyper-up/native_posix.keymap
@@ -0,0 +1,28 @@
+#include <dt-bindings/zmk/keys.h>
+#include <behaviors.dtsi>
+#include <dt-bindings/zmk/kscan-mock.h>
+
+
+&kscan {
+ events = <
+ ZMK_MOCK_PRESS(0,0,10)
+ ZMK_MOCK_PRESS(1,0,10)
+ ZMK_MOCK_RELEASE(1,0,10)
+ ZMK_MOCK_RELEASE(0,0,10)
+
+ >;
+};
+
+/ {
+ keymap {
+ compatible = "zmk,keymap";
+ label ="Default keymap";
+
+ default_layer {
+ bindings = <
+ &kp LS(LA(LG(LEFT_CONTROL))) &kp LEFT_CONTROL
+ &kp A &none
+ >;
+ };
+ };
+};