diff options
author | Okke Formsma <okke@formsma.nl> | 2021-04-05 20:07:39 +0200 |
---|---|---|
committer | Pete Johanson <peter@peterjohanson.com> | 2021-05-09 07:52:41 -0400 |
commit | de4979bf58a628692547b056c80a75678005a647 (patch) | |
tree | fa59f5fb5501c1b25ffe6ad178038797e6512b5c /app/tests/sticky-keys/2-os-dn-up-kcdn-kcup-quick-release/native_posix.keymap | |
parent | a00697082531785dff3b9516d9178d3ec367d8f1 (diff) |
fix(behaviors): Fix sticky keys quick-release for normal keypresses
Quick release for sticky keys failed for non-layer keys. The sticky key
was released just before the key that was supposed to be modified was
handled.
The issue was caused by an error in the sticky key logic, which released
the sticky key before handling the key up event.
Fixes #696.
Diffstat (limited to 'app/tests/sticky-keys/2-os-dn-up-kcdn-kcup-quick-release/native_posix.keymap')
-rw-r--r-- | app/tests/sticky-keys/2-os-dn-up-kcdn-kcup-quick-release/native_posix.keymap | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/app/tests/sticky-keys/2-os-dn-up-kcdn-kcup-quick-release/native_posix.keymap b/app/tests/sticky-keys/2-os-dn-up-kcdn-kcup-quick-release/native_posix.keymap new file mode 100644 index 0000000..3311545 --- /dev/null +++ b/app/tests/sticky-keys/2-os-dn-up-kcdn-kcup-quick-release/native_posix.keymap @@ -0,0 +1,26 @@ +#include <dt-bindings/zmk/keys.h> +#include <behaviors.dtsi> +#include <dt-bindings/zmk/kscan_mock.h> +#include "../behavior_keymap.dtsi" + +&sk { + quick-release; +}; + +&kscan { + events = < + ZMK_MOCK_PRESS(0,0,10) + ZMK_MOCK_RELEASE(0,0,10) + ZMK_MOCK_PRESS(1,0,10) + /* second key is pressed shortly after the first. It should not be capitalized. */ + ZMK_MOCK_PRESS(1,1,10) + ZMK_MOCK_RELEASE(1,0,10) + ZMK_MOCK_RELEASE(1,1,10) + + /* repeat test to check if cleanup is done correctly */ + ZMK_MOCK_PRESS(0,0,10) + ZMK_MOCK_RELEASE(0,0,10) + ZMK_MOCK_PRESS(1,0,10) + ZMK_MOCK_RELEASE(1,0,10) + >; +};
\ No newline at end of file |