summaryrefslogtreecommitdiff
path: root/quantum/action.c
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2022-03-13 18:11:42 -0700
committerGitHub <noreply@github.com>2022-03-14 01:11:42 +0000
commitb8574efcd67a394c423ac29ce280ee09517a1aee (patch)
tree1b8b4e6250fbcac53dff50acadb403a7d2199e1f /quantum/action.c
parent42d084d1c0816366a68b8614b395062fc6e47ec0 (diff)
Fix oneshot toggle logic (#16630)
* Fix oneshot toggle logic * Enable oneshots by default * Decrement eeconfig magic number due to eeconfig changes
Diffstat (limited to 'quantum/action.c')
-rw-r--r--quantum/action.c10
1 files changed, 5 insertions, 5 deletions
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) {
101 keyrecord_t record = {.event = event}; 101 keyrecord_t record = {.event = event};
102 102
103#ifndef NO_ACTION_ONESHOT 103#ifndef NO_ACTION_ONESHOT
104 if (!keymap_config.oneshot_disable) { 104 if (keymap_config.oneshot_enable) {
105# if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0)) 105# if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0))
106 if (has_oneshot_layer_timed_out()) { 106 if (has_oneshot_layer_timed_out()) {
107 clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED); 107 clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
@@ -258,7 +258,7 @@ void process_record(keyrecord_t *record) {
258 258
259 if (!process_record_quantum(record)) { 259 if (!process_record_quantum(record)) {
260#ifndef NO_ACTION_ONESHOT 260#ifndef NO_ACTION_ONESHOT
261 if (is_oneshot_layer_active() && record->event.pressed && !keymap_config.oneshot_disable) { 261 if (is_oneshot_layer_active() && record->event.pressed && keymap_config.oneshot_enable) {
262 clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED); 262 clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
263 } 263 }
264#endif 264#endif
@@ -323,7 +323,7 @@ void process_action(keyrecord_t *record, action_t action) {
323# ifdef SWAP_HANDS_ENABLE 323# ifdef SWAP_HANDS_ENABLE
324 && !(action.kind.id == ACT_SWAP_HANDS && action.swap.code == OP_SH_ONESHOT) 324 && !(action.kind.id == ACT_SWAP_HANDS && action.swap.code == OP_SH_ONESHOT)
325# endif 325# endif
326 && !keymap_config.oneshot_disable) { 326 && keymap_config.oneshot_enable) {
327 clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED); 327 clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
328 do_release_oneshot = !is_oneshot_layer_active(); 328 do_release_oneshot = !is_oneshot_layer_active();
329 } 329 }
@@ -367,7 +367,7 @@ void process_action(keyrecord_t *record, action_t action) {
367# ifndef NO_ACTION_ONESHOT 367# ifndef NO_ACTION_ONESHOT
368 case MODS_ONESHOT: 368 case MODS_ONESHOT:
369 // Oneshot modifier 369 // Oneshot modifier
370 if (keymap_config.oneshot_disable) { 370 if (!keymap_config.oneshot_enable) {
371 if (event.pressed) { 371 if (event.pressed) {
372 if (mods) { 372 if (mods) {
373 if (IS_MOD(action.key.code) || action.key.code == KC_NO) { 373 if (IS_MOD(action.key.code) || action.key.code == KC_NO) {
@@ -613,7 +613,7 @@ void process_action(keyrecord_t *record, action_t action) {
613# ifndef NO_ACTION_ONESHOT 613# ifndef NO_ACTION_ONESHOT
614 case OP_ONESHOT: 614 case OP_ONESHOT:
615 // Oneshot modifier 615 // Oneshot modifier
616 if (keymap_config.oneshot_disable) { 616 if (!keymap_config.oneshot_enable) {
617 if (event.pressed) { 617 if (event.pressed) {
618 layer_on(action.layer_tap.val); 618 layer_on(action.layer_tap.val);
619 } else { 619 } else {