diff options
author | Jack Humbert <jack.humb@gmail.com> | 2017-02-15 11:25:33 -0500 |
---|---|---|
committer | Jack Humbert <jack.humb@gmail.com> | 2017-02-15 11:25:33 -0500 |
commit | 69ea10f9a9407415d8cbb5575a08bd73d5ddd7f9 (patch) | |
tree | ca2ed059803bdb8316b76272dafafe54593758cf | |
parent | 7bef285553dee01bbcb1eaadefbfb39ed75baea4 (diff) | |
download | qmk_firmware-69ea10f9a9407415d8cbb5575a08bd73d5ddd7f9.tar.gz qmk_firmware-69ea10f9a9407415d8cbb5575a08bd73d5ddd7f9.zip |
adds layer tap toggle
-rw-r--r-- | quantum/keymap_common.c | 3 | ||||
-rw-r--r-- | quantum/quantum_keycodes.h | 13 |
2 files changed, 12 insertions, 4 deletions
diff --git a/quantum/keymap_common.c b/quantum/keymap_common.c index 54b872d49e..002eabd85e 100644 --- a/quantum/keymap_common.c +++ b/quantum/keymap_common.c @@ -119,6 +119,9 @@ action_t action_for_key(uint8_t layer, keypos_t key) mod = keycode & 0xFF; action.code = ACTION_MODS_ONESHOT(mod); break; + case QK_LAYER_TAP_TOGGLE ... QK_LAYER_TAP_TOGGLE_MAX: + action.code = ACTION_LAYER_TAP_TOGGLE(keycode & 0xFF); + break; case QK_MOD_TAP ... QK_MOD_TAP_MAX: action.code = ACTION_MODS_TAP_KEY((keycode >> 0x8) & 0x1F, keycode & 0xFF); break; diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index cc7a5013f6..f36c8044e9 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h @@ -41,16 +41,18 @@ enum quantum_keycodes { #endif QK_TAP_DANCE = 0x5700, QK_TAP_DANCE_MAX = 0x57FF, -#ifdef UNICODEMAP_ENABLE - QK_UNICODE_MAP = 0x5800, - QK_UNICODE_MAP_MAX = 0x5BFF, -#endif + QK_LAYER_TAP_TOGGLE = 0x5800, + QK_LAYER_TAP_TOGGLE_MAX = 0x58FF, QK_MOD_TAP = 0x6000, QK_MOD_TAP_MAX = 0x7FFF, #ifdef UNICODE_ENABLE QK_UNICODE = 0x8000, QK_UNICODE_MAX = 0xFFFF, #endif +#ifdef UNICODEMAP_ENABLE + QK_UNICODE_MAP = 0x8000, + QK_UNICODE_MAP_MAX = 0x83FF, +#endif // Loose keycodes - to be used directly @@ -304,6 +306,9 @@ enum quantum_keycodes { // One-shot mod #define OSM(mod) (mod | QK_ONE_SHOT_MOD) +// Layer tap-toggle +#define TT(layer) (layer | QK_LAYER_TAP_TOGGLE) + // M-od, T-ap - 256 keycode max #define MT(mod, kc) (kc | QK_MOD_TAP | ((mod & 0x1F) << 8)) |