diff options
author | Peter Johanson <[email protected]> | 2021-11-29 15:41:22 +0000 |
---|---|---|
committer | Pete Johanson <[email protected]> | 2022-01-30 22:47:34 -0500 |
commit | 52b1fd5dd3f1cb260cd0fba28c4b5aa23dd3d0f0 (patch) | |
tree | ec134dd3f0ddc8ea31846df110f795a8d566484b /app/src/behaviors | |
parent | 70bb7c93349344e0990f12282abfcd8d00ba7208 (diff) | |
download | zmk-52b1fd5dd3f1cb260cd0fba28c4b5aa23dd3d0f0.tar.gz zmk-52b1fd5dd3f1cb260cd0fba28c4b5aa23dd3d0f0.zip |
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.
Diffstat (limited to 'app/src/behaviors')
-rw-r--r-- | app/src/behaviors/behavior_key_repeat.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/src/behaviors/behavior_key_repeat.c b/app/src/behaviors/behavior_key_repeat.c index b2e28a6ee2..22de37d973 100644 --- a/app/src/behaviors/behavior_key_repeat.c +++ b/app/src/behaviors/behavior_key_repeat.c @@ -10,6 +10,7 @@ #include <drivers/behavior.h> #include <logging/log.h> #include <zmk/behavior.h> +#include <zmk/hid.h> #include <zmk/event_manager.h> #include <zmk/events/keycode_state_changed.h> @@ -93,6 +94,7 @@ static int key_repeat_keycode_state_changed_listener(const zmk_event_t *eh) { for (int u = 0; u < config->usage_pages_count; u++) { if (config->usage_pages[u] == ev->usage_page) { memcpy(&data->last_keycode_pressed, ev, sizeof(struct zmk_keycode_state_changed)); + data->last_keycode_pressed.implicit_modifiers |= zmk_hid_get_explicit_mods(); break; } } |