Fix oneshot toggle logic (#16630)
* Fix oneshot toggle logic * Enable oneshots by default * Decrement eeconfig magic number due to eeconfig changes
This commit is contained in:
parent
42d084d1c0
commit
b8574efcd6
5 changed files with 15 additions and 16 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue