diff options
author | Jack Humbert <[email protected]> | 2015-10-26 20:02:25 -0400 |
---|---|---|
committer | Jack Humbert <[email protected]> | 2015-10-26 20:02:25 -0400 |
commit | cc1c32671eb1eb43a87e55ac4ffa60b15115e48d (patch) | |
tree | 4f57c95c9c22d858b1eac8bcd3d489c0d6214719 /quantum/keymap_common.c | |
parent | 402122744c26704f378cda828d30bf11e8d6dabf (diff) | |
download | qmk_firmware-cc1c32671eb1eb43a87e55ac4ffa60b15115e48d.tar.gz qmk_firmware-cc1c32671eb1eb43a87e55ac4ffa60b15115e48d.zip |
fixed makefile, added MO DF shortcuts
Diffstat (limited to 'quantum/keymap_common.c')
-rw-r--r-- | quantum/keymap_common.c | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/quantum/keymap_common.c b/quantum/keymap_common.c index c9e1494fd9..5c00c0afa2 100644 --- a/quantum/keymap_common.c +++ b/quantum/keymap_common.c @@ -78,12 +78,30 @@ action_t action_for_key(uint8_t layer, keypos_t key) print("\nDEBUG: enabled.\n"); debug_enable = true; return; - } else if (keycode >= 0x5000 && keycode < 0x6000) { - int when = (keycode >> 0x9) & 0x3; - int layer = keycode & 0xFF; - action_t action; - action.code = ACTION_LAYER_SET(layer, when); - return action; + } else if (keycode >= 0x5000 && keycode < 0x6000) { + // Layer movement shortcuts + // See .h to see constraints/usage + int type = (keycode >> 0x8) & 0xF; + if (type == 0x1) { + // Layer set "GOTO" + int when = (keycode >> 0x4) & 0x3; + int layer = keycode & 0xF; + action_t action; + action.code = ACTION_LAYER_SET(layer, when); + return action; + } else if (type == 0x2) { + // Momentary layer + int layer = keycode & 0xFF; + action_t action; + action.code = ACTION_LAYER_MOMENTARY(layer); + return action; + } else if (type == 0x3) { + // Set default layer + int layer = keycode & 0xFF; + action_t action; + action.code = ACTION_DEFAULT_LAYER_SET(layer); + return action; + } #ifdef MIDI_ENABLE } else if (keycode >= 0x6000 && keycode < 0x7000) { action_t action; |