summaryrefslogtreecommitdiffstats
path: root/quantum/action_util.c
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2021-11-01 09:41:24 -0700
committerGitHub <noreply@github.com>2021-11-01 09:41:24 -0700
commit2980c63d3d4480a10bb1f7e6cf417bc9c9b65b72 (patch)
treed8ea4fd23db524ca69c1c518153e72a70d5642b9 /quantum/action_util.c
parentf7e94f6624cc06a0403ec3b20e12ff558132459d (diff)
Fix issues with Oneshot disabling (#14934)
Diffstat (limited to 'quantum/action_util.c')
-rw-r--r--quantum/action_util.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/quantum/action_util.c b/quantum/action_util.c
index 9a85bd5040..78e02aec18 100644
--- a/quantum/action_util.c
+++ b/quantum/action_util.c
@@ -170,7 +170,7 @@ void reset_oneshot_layer(void) {
void clear_oneshot_layer_state(oneshot_fullfillment_t state) {
uint8_t start_state = oneshot_layer_data;
oneshot_layer_data &= ~state;
- if ((!get_oneshot_layer_state() && start_state != oneshot_layer_data) || keymap_config.oneshot_disable) {
+ if ((!get_oneshot_layer_state() && start_state != oneshot_layer_data) && !keymap_config.oneshot_disable) {
layer_off(get_oneshot_layer());
reset_oneshot_layer();
}
@@ -189,6 +189,7 @@ void oneshot_set(bool active) {
if (keymap_config.oneshot_disable != active) {
keymap_config.oneshot_disable = active;
eeconfig_update_keymap(keymap_config.raw);
+ clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
dprintf("Oneshot: active: %d\n", active);
}
}