-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(behaviors): Capture mods for
&key_repeat
* When tracking the last keycode, also capture the currently held explicit modifiers to use when replaying the key later.
- Loading branch information
1 parent
70bb7c9
commit 52b1fd5
Showing
5 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
default_layer { | ||
bindings = < | ||
&key_repeat &kp A | ||
&kp B &kp C_VOL_UP | ||
&kp LCTRL &kp C_VOL_UP | ||
>; | ||
}; | ||
}; | ||
|
2 changes: 2 additions & 0 deletions
2
app/tests/key-repeat/press-and-release-with-explicit-modifiers/events.patterns
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
s/.*hid_listener_keycode_//p | ||
s/.*hid_implicit_modifiers_//p |
12 changes: 12 additions & 0 deletions
12
app/tests/key-repeat/press-and-release-with-explicit-modifiers/keycode_events.snapshot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
pressed: usage_page 0x07 keycode 0xe0 implicit_mods 0x00 explicit_mods 0x00 | ||
press: Modifiers set to 0x01 | ||
pressed: usage_page 0x07 keycode 0x04 implicit_mods 0x00 explicit_mods 0x00 | ||
press: Modifiers set to 0x01 | ||
released: usage_page 0x07 keycode 0x04 implicit_mods 0x00 explicit_mods 0x00 | ||
release: Modifiers set to 0x01 | ||
released: usage_page 0x07 keycode 0xe0 implicit_mods 0x00 explicit_mods 0x00 | ||
release: Modifiers set to 0x00 | ||
pressed: usage_page 0x07 keycode 0x04 implicit_mods 0x01 explicit_mods 0x00 | ||
press: Modifiers set to 0x01 | ||
released: usage_page 0x07 keycode 0x04 implicit_mods 0x01 explicit_mods 0x00 | ||
release: Modifiers set to 0x00 |
15 changes: 15 additions & 0 deletions
15
app/tests/key-repeat/press-and-release-with-explicit-modifiers/native_posix.keymap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#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(1,0,10) | ||
ZMK_MOCK_PRESS(0,1,10) | ||
ZMK_MOCK_RELEASE(0,1,10) | ||
ZMK_MOCK_RELEASE(1,0,10) | ||
ZMK_MOCK_PRESS(0,0,10) | ||
ZMK_MOCK_RELEASE(0,0,10) | ||
>; | ||
}; |