summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Diamond <josh@windowoffire.com>2020-06-18 03:07:48 -0400
committerDrashna Jael're <drashna@live.com>2020-08-08 21:16:15 -0700
commit4badbca51731bcdb63b3b52ac5e1fcdaf356aac2 (patch)
treea97ea3136e69ea5b91fdab720b05c86da4cfe004
parentbbc30127f9e051af7b2903766bfcc53b84bf0d5c (diff)
Fix for One Shot Layer not being cleaned up after some actions (#8832)
-rw-r--r--tmk_core/common/action.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c
index d7b766becd..9a808f43e8 100644
--- a/tmk_core/common/action.c
+++ b/tmk_core/common/action.c
@@ -192,7 +192,14 @@ void process_record(keyrecord_t *record) {
return;
}
- if (!process_record_quantum(record)) return;
+ if (!process_record_quantum(record)) {
+#ifndef NO_ACTION_ONESHOT
+ if (is_oneshot_layer_active() && record->event.pressed) {
+ clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
+ }
+#endif
+ return;
+ }
process_record_handler(record);
post_process_record_quantum(record);
@@ -231,7 +238,7 @@ void process_action(keyrecord_t *record, action_t action) {
#ifndef NO_ACTION_ONESHOT
bool do_release_oneshot = false;
// notice we only clear the one shot layer if the pressed key is not a modifier.
- if (is_oneshot_layer_active() && event.pressed && !IS_MOD(action.key.code)
+ if (is_oneshot_layer_active() && event.pressed && (action.kind.id == ACT_USAGE || !IS_MOD(action.key.code))
# ifdef SWAP_HANDS_ENABLE
&& !(action.kind.id == ACT_SWAP_HANDS && action.swap.code == OP_SH_ONESHOT)
# endif