Skip to content

Commit

Permalink
Fix flipped One Shot logic (qmk#16617)
Browse files Browse the repository at this point in the history
  • Loading branch information
getreuer authored and zykrah committed Jul 2, 2022
1 parent ceaf5a6 commit cdfb557
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions quantum/action_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,9 @@ bool is_oneshot_layer_active(void) {
* FIXME: needs doc
*/
void oneshot_set(bool active) {
if (keymap_config.oneshot_disable != active) {
keymap_config.oneshot_disable = active;
const bool disable = !active;
if (keymap_config.oneshot_disable != disable) {
keymap_config.oneshot_disable = disable;
eeconfig_update_keymap(keymap_config.raw);
clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
dprintf("Oneshot: active: %d\n", active);
Expand Down Expand Up @@ -220,7 +221,7 @@ void oneshot_disable(void) {
}

bool is_oneshot_enabled(void) {
return keymap_config.oneshot_disable;
return !keymap_config.oneshot_disable;
}

#endif
Expand Down

0 comments on commit cdfb557

Please sign in to comment.