diff options
author | Joshua Diamond <josh@windowoffire.com> | 2020-06-18 03:07:48 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-18 08:07:48 +0100 |
commit | 9c1097e768aed90e4c56a3a18f6c1cc9cac52391 (patch) | |
tree | 76b783dd8fc4a7b685a1702e64e1c2d058e9f81a | |
parent | f7eb030e917a8fa360ad7cc7bb26d804cf4c5f6c (diff) | |
download | qmk_firmware-9c1097e768aed90e4c56a3a18f6c1cc9cac52391.tar.gz qmk_firmware-9c1097e768aed90e4c56a3a18f6c1cc9cac52391.zip |
Fix for One Shot Layer not being cleaned up after some actions (#8832)
-rw-r--r-- | tmk_core/common/action.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index b39836f0f..82be9cc92 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c | |||
@@ -192,7 +192,14 @@ void process_record(keyrecord_t *record) { | |||
192 | return; | 192 | return; |
193 | } | 193 | } |
194 | 194 | ||
195 | if (!process_record_quantum(record)) return; | 195 | if (!process_record_quantum(record)) { |
196 | #ifndef NO_ACTION_ONESHOT | ||
197 | if (is_oneshot_layer_active() && record->event.pressed) { | ||
198 | clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED); | ||
199 | } | ||
200 | #endif | ||
201 | return; | ||
202 | } | ||
196 | 203 | ||
197 | process_record_handler(record); | 204 | process_record_handler(record); |
198 | post_process_record_quantum(record); | 205 | post_process_record_quantum(record); |
@@ -231,7 +238,7 @@ void process_action(keyrecord_t *record, action_t action) { | |||
231 | #ifndef NO_ACTION_ONESHOT | 238 | #ifndef NO_ACTION_ONESHOT |
232 | bool do_release_oneshot = false; | 239 | bool do_release_oneshot = false; |
233 | // notice we only clear the one shot layer if the pressed key is not a modifier. | 240 | // notice we only clear the one shot layer if the pressed key is not a modifier. |
234 | if (is_oneshot_layer_active() && event.pressed && !IS_MOD(action.key.code) | 241 | if (is_oneshot_layer_active() && event.pressed && (action.kind.id == ACT_USAGE || !IS_MOD(action.key.code)) |
235 | # ifdef SWAP_HANDS_ENABLE | 242 | # ifdef SWAP_HANDS_ENABLE |
236 | && !(action.kind.id == ACT_SWAP_HANDS && action.swap.code == OP_SH_ONESHOT) | 243 | && !(action.kind.id == ACT_SWAP_HANDS && action.swap.code == OP_SH_ONESHOT) |
237 | # endif | 244 | # endif |