diff options
author | Konstantin Đorđević <vomindoraan@gmail.com> | 2018-12-28 20:07:56 +0100 |
---|---|---|
committer | MechMerlin <30334081+mechmerlin@users.noreply.github.com> | 2018-12-28 11:07:56 -0800 |
commit | 93b004c943a4b13bd640fc83000e910b72cb4640 (patch) | |
tree | 48bde7eb31533cc3690f5638a2803deadfea0fc0 /tmk_core/common/action_layer.c | |
parent | fbcbf4492685108a7f257df4e06871abd9def4d7 (diff) |
Keep pressed keys on layer state change (fixes #2053, #2279) (#3905)
* Keep pressed keys on layer state change
* Add doc comment for clear_keyboard_but_mods_and_keys
* Keep pressed keys only if PREVENT_STUCK_MODIFIERS is on
* Check STRICT_LAYER_RELEASE instead of PREVENT_STUCK_MODIFIERS
Diffstat (limited to 'tmk_core/common/action_layer.c')
-rw-r--r-- | tmk_core/common/action_layer.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tmk_core/common/action_layer.c b/tmk_core/common/action_layer.c index b8dcb34f3a..120ce3f51b 100644 --- a/tmk_core/common/action_layer.c +++ b/tmk_core/common/action_layer.c @@ -44,7 +44,11 @@ static void default_layer_state_set(uint32_t state) default_layer_debug(); debug(" to "); default_layer_state = state; default_layer_debug(); debug("\n"); +#ifdef STRICT_LAYER_RELEASE clear_keyboard_but_mods(); // To avoid stuck keys +#else + clear_keyboard_but_mods_and_keys(); // Don't reset held keys +#endif } /** \brief Default Layer Print @@ -127,7 +131,11 @@ void layer_state_set(uint32_t state) layer_debug(); dprint(" to "); layer_state = state; layer_debug(); dprintln(); +#ifdef STRICT_LAYER_RELEASE clear_keyboard_but_mods(); // To avoid stuck keys +#else + clear_keyboard_but_mods_and_keys(); // Don't reset held keys +#endif } /** \brief Layer clear |