Ensure held OSL is properly released when nesting OSL

This commit is contained in:
Krister Svanlund 2024-01-19 23:28:12 +01:00
parent 548983abc8
commit 399f17f84b

View File

@ -665,10 +665,14 @@ 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 {
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);
} }
} }
}
# else # else
if (event.pressed) { if (event.pressed) {
layer_on(action.layer_tap.val); layer_on(action.layer_tap.val);