From 14dfeae9a31e8324f62d081390f980a780edc7aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Csilla=20Nagyn=C3=A9=20Martin=C3=A1k?= Date: Tue, 3 Oct 2017 23:18:37 +0200 Subject: [PATCH] Rename the layer helper macros MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As discussed in #190, and later on IRC, this renames ToggleLayer to LockLayer (updating the documentation at the same time), and introduces the UnlockLayer alias, for clarity. MomentaryLayer also got a new name: ShiftToLayer, and new documentation to go with it. Signed-off-by: Csilla Nagyné Martinák --- src/key_defs_keymaps.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/key_defs_keymaps.h b/src/key_defs_keymaps.h index 2a342ff1..7c5d3b48 100644 --- a/src/key_defs_keymaps.h +++ b/src/key_defs_keymaps.h @@ -33,18 +33,18 @@ #define Key_KeymapPrevious_Momentary (Key) { KEYMAP_PREVIOUS + MOMENTARY_OFFSET, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP } -/** Toggle layer `n` on and off. +/** Lock/Unlock layer `n`. * - * Toggle layer `n` on and off on subsequent key presses, just like - * `Key_Keymap0` and friends. `n` can be a number, or an enum value declared - * previously. + * When locking a layer, it will remain active until unlocked explicitly. `n` + * can be a number, or an enum value declared previously. */ -#define ToggleLayer(n) (Key){ n, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP } +#define LockLayer(n) (Key){ n, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP } +#define UnlockLayer(n) LockLayer(n) -/** Momentarily toggle layer `n` until the key is held. +/** Temporarily shift to layer `n`. * - * Toggle layer `n` on for as long as the key is held, and turn it off when - * released, just like `Key_Keymap0_Momentary` and friends. `n` can be a - * number, or an enum value declared previously. + * Shifts to layer `n` for as long as the key is held. When the key is + * released, the layer shifts back too. `n` can be a number, or an enum + * value declared previously. */ -#define MomentaryLayer(n) (Key){ n + MOMENTARY_OFFSET, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP } +#define ShiftToLayer(n) (Key){ n + MOMENTARY_OFFSET, KEY_FLAGS | SYNTHETIC | SWITCH_TO_KEYMAP }