Skip to content

Commit

Permalink
toggle: Toggle layer immediately on keypress (#683)
Browse files Browse the repository at this point in the history
  • Loading branch information
rvaiya committed Mar 6, 2024
1 parent 5832c75 commit 77d1d83
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/keyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ static long process_descriptor(struct keyboard *kbd, uint8_t code,
case OP_TOGGLE:
idx = d->args[0].idx;

if (!pressed) {
if (pressed) {
kbd->layer_state[idx].toggled = !kbd->layer_state[idx].toggled;

if (kbd->layer_state[idx].toggled)
Expand All @@ -705,7 +705,6 @@ static long process_descriptor(struct keyboard *kbd, uint8_t code,
deactivate_layer(kbd, idx);

update_mods(kbd, -1, 0);
} else {
clear_oneshot(kbd);
}

Expand Down

0 comments on commit 77d1d83

Please sign in to comment.