Added support for case where ONESHOT_TAP_TOGGLE is unset

This commit is contained in:
Krister Svanlund 2024-01-19 23:59:47 +01:00
parent 399f17f84b
commit f24a2b6127

View File

@ -665,18 +665,18 @@ void process_action(keyrecord_t *record, action_t action) {
if (tap_count >= ONESHOT_TAP_TOGGLE) {
reset_oneshot_layer();
set_oneshot_layer(action.layer_tap.val, ONESHOT_TOGGLED);
} else {
if (get_oneshot_layer() != action.layer_tap.val) {
layer_off(action.layer_tap.val);
} else if (get_oneshot_layer() != action.layer_tap.val) {
layer_off(action.layer_tap.val);
} else {
clear_oneshot_layer_state(ONESHOT_PRESSED);
}
}
}
# else
if (event.pressed) {
layer_on(action.layer_tap.val);
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 {
clear_oneshot_layer_state(ONESHOT_PRESSED);
if (tap_count > 1) {