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
This commit is contained in:
snyman 2018-03-20 22:59:54 -04:00 committed by Jack Humbert
parent 4ec03111cc
commit 7a5ce36f23
4 changed files with 21 additions and 9 deletions

View file

@ -71,6 +71,8 @@ enum quantum_keycodes {
QK_TAP_DANCE_MAX = 0x57FF,
QK_LAYER_TAP_TOGGLE = 0x5800,
QK_LAYER_TAP_TOGGLE_MAX = 0x58FF,
QK_LAYER_MOD = 0x5900,
QK_LAYER_MOD_MAX = 0x59FF,
#ifdef STENO_ENABLE
QK_STENO = 0x5A00,
QK_STENO_BOLT = 0x5A30,
@ -597,6 +599,9 @@ enum quantum_keycodes {
// One-shot layer - 256 layer max
#define OSL(layer) (layer | QK_ONE_SHOT_LAYER)
// L-ayer M-od: Momentary switch layer with modifiers active - 16 layer max, left mods only
#define LM(layer, mod) (QK_LAYER_MOD | (((layer) & 0xF) << 4) | ((mod) & 0xF))
// One-shot mod
#define OSM(mod) ((mod) | QK_ONE_SHOT_MOD)