mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-04-24 16:11:28 +00:00
Added support for case where ONESHOT_TAP_TOGGLE is unset
This commit is contained in:
parent
399f17f84b
commit
f24a2b6127
@ -665,18 +665,18 @@ void process_action(keyrecord_t *record, action_t action) {
|
|||||||
if (tap_count >= ONESHOT_TAP_TOGGLE) {
|
if (tap_count >= ONESHOT_TAP_TOGGLE) {
|
||||||
reset_oneshot_layer();
|
reset_oneshot_layer();
|
||||||
set_oneshot_layer(action.layer_tap.val, ONESHOT_TOGGLED);
|
set_oneshot_layer(action.layer_tap.val, ONESHOT_TOGGLED);
|
||||||
} else {
|
} else if (get_oneshot_layer() != action.layer_tap.val) {
|
||||||
if (get_oneshot_layer() != action.layer_tap.val) {
|
|
||||||
layer_off(action.layer_tap.val);
|
layer_off(action.layer_tap.val);
|
||||||
} else {
|
} else {
|
||||||
clear_oneshot_layer_state(ONESHOT_PRESSED);
|
clear_oneshot_layer_state(ONESHOT_PRESSED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
# else
|
# else
|
||||||
if (event.pressed) {
|
if (event.pressed) {
|
||||||
layer_on(action.layer_tap.val);
|
layer_on(action.layer_tap.val);
|
||||||
set_oneshot_layer(action.layer_tap.val, ONESHOT_START);
|
set_oneshot_layer(action.layer_tap.val, ONESHOT_START);
|
||||||
|
} else if (get_oneshot_layer() != action.layer_tap.val) {
|
||||||
|
layer_off(action.layer_tap.val);
|
||||||
} else {
|
} else {
|
||||||
clear_oneshot_layer_state(ONESHOT_PRESSED);
|
clear_oneshot_layer_state(ONESHOT_PRESSED);
|
||||||
if (tap_count > 1) {
|
if (tap_count > 1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user