From b8574efcd67a394c423ac29ce280ee09517a1aee Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sun, 13 Mar 2022 18:11:42 -0700 Subject: Fix oneshot toggle logic (#16630) * Fix oneshot toggle logic * Enable oneshots by default * Decrement eeconfig magic number due to eeconfig changes --- quantum/action.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'quantum/action.c') diff --git a/quantum/action.c b/quantum/action.c index 60301fa606..ef059f0e2a 100644 --- a/quantum/action.c +++ b/quantum/action.c @@ -101,7 +101,7 @@ void action_exec(keyevent_t event) { keyrecord_t record = {.event = event}; #ifndef NO_ACTION_ONESHOT - if (!keymap_config.oneshot_disable) { + if (keymap_config.oneshot_enable) { # if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0)) if (has_oneshot_layer_timed_out()) { clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED); @@ -258,7 +258,7 @@ void process_record(keyrecord_t *record) { if (!process_record_quantum(record)) { #ifndef NO_ACTION_ONESHOT - if (is_oneshot_layer_active() && record->event.pressed && !keymap_config.oneshot_disable) { + if (is_oneshot_layer_active() && record->event.pressed && keymap_config.oneshot_enable) { clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED); } #endif @@ -323,7 +323,7 @@ void process_action(keyrecord_t *record, action_t action) { # ifdef SWAP_HANDS_ENABLE && !(action.kind.id == ACT_SWAP_HANDS && action.swap.code == OP_SH_ONESHOT) # endif - && !keymap_config.oneshot_disable) { + && keymap_config.oneshot_enable) { clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED); do_release_oneshot = !is_oneshot_layer_active(); } @@ -367,7 +367,7 @@ void process_action(keyrecord_t *record, action_t action) { # ifndef NO_ACTION_ONESHOT case MODS_ONESHOT: // Oneshot modifier - if (keymap_config.oneshot_disable) { + if (!keymap_config.oneshot_enable) { if (event.pressed) { if (mods) { if (IS_MOD(action.key.code) || action.key.code == KC_NO) { @@ -613,7 +613,7 @@ void process_action(keyrecord_t *record, action_t action) { # ifndef NO_ACTION_ONESHOT case OP_ONESHOT: // Oneshot modifier - if (keymap_config.oneshot_disable) { + if (!keymap_config.oneshot_enable) { if (event.pressed) { layer_on(action.layer_tap.val); } else { -- cgit v1.2.3