layers: Fix the layer toggle behaviour

When toggling a layer, the same keycode should toggle the layer off, too.
Without this, toggling layers won't work at all, because the target layer will
never be turned off.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
pull/92/head
Gergely Nagy 8 years ago
parent 867f9507ed
commit 361df26094

@ -29,6 +29,9 @@ static void handle_keymap_key_event(Key keymapEntry, uint8_t keyState) {
// switch keymap and stay there
} else if (key_toggled_on(keyState)) {
if (Layer.isOn (keymapEntry.keyCode) && keymapEntry.keyCode)
Layer.off(keymapEntry.keyCode);
else
Layer.on(keymapEntry.keyCode);
}
}

Loading…
Cancel
Save