From 7a5ce36f23624b29b548f9e8f8e3a0b165cdf2a4 Mon Sep 17 00:00:00 2001 From: snyman Date: Tue, 20 Mar 2018 22:59:54 -0400 Subject: Add macro for momentarily switching to a layer while some mods are active (#2460) * Macro for a momentary layer switch with mods Passes through to the existing ACTION_LAYER_MODS macro, albeit with more limited options due to lack of space in the quantum_keycodes enum. * Add documentation for LM layer-mod macro * Clean up Tap Toggle documentation --- quantum/keymap_common.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'quantum/keymap_common.c') diff --git a/quantum/keymap_common.c b/quantum/keymap_common.c index 8b09f93fce..9a412b66ad 100644 --- a/quantum/keymap_common.c +++ b/quantum/keymap_common.c @@ -122,6 +122,11 @@ action_t action_for_key(uint8_t layer, keypos_t key) case QK_LAYER_TAP_TOGGLE ... QK_LAYER_TAP_TOGGLE_MAX: action.code = ACTION_LAYER_TAP_TOGGLE(keycode & 0xFF); break; + case QK_LAYER_MOD ... QK_LAYER_MOD_MAX: + mod = keycode & 0xF; + action_layer = (keycode >> 4) & 0xF; + action.code = ACTION_LAYER_MODS(action_layer, mod); + break; case QK_MOD_TAP ... QK_MOD_TAP_MAX: mod = mod_config((keycode >> 0x8) & 0x1F); action.code = ACTION_MODS_TAP_KEY(mod, keycode & 0xFF); -- cgit v1.2.3