aboutsummaryrefslogtreecommitdiff
path: root/quantum/keymap_common.c
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2015-10-26 20:02:25 -0400
committerJack Humbert <jack.humb@gmail.com>2015-10-26 20:02:25 -0400
commitcc1c32671eb1eb43a87e55ac4ffa60b15115e48d (patch)
tree4f57c95c9c22d858b1eac8bcd3d489c0d6214719 /quantum/keymap_common.c
parent402122744c26704f378cda828d30bf11e8d6dabf (diff)
downloadqmk_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.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/quantum/keymap_common.c b/quantum/keymap_common.c
index c9e1494fd..5c00c0afa 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)
78 print("\nDEBUG: enabled.\n"); 78 print("\nDEBUG: enabled.\n");
79 debug_enable = true; 79 debug_enable = true;
80 return; 80 return;
81 } else if (keycode >= 0x5000 && keycode < 0x6000) { 81 } else if (keycode >= 0x5000 && keycode < 0x6000) {
82 int when = (keycode >> 0x9) & 0x3; 82 // Layer movement shortcuts
83 int layer = keycode & 0xFF; 83 // See .h to see constraints/usage
84 action_t action; 84 int type = (keycode >> 0x8) & 0xF;
85 action.code = ACTION_LAYER_SET(layer, when); 85 if (type == 0x1) {
86 return action; 86 // Layer set "GOTO"
87 int when = (keycode >> 0x4) & 0x3;
88 int layer = keycode & 0xF;
89 action_t action;
90 action.code = ACTION_LAYER_SET(layer, when);
91 return action;
92 } else if (type == 0x2) {
93 // Momentary layer
94 int layer = keycode & 0xFF;
95 action_t action;
96 action.code = ACTION_LAYER_MOMENTARY(layer);
97 return action;
98 } else if (type == 0x3) {
99 // Set default layer
100 int layer = keycode & 0xFF;
101 action_t action;
102 action.code = ACTION_DEFAULT_LAYER_SET(layer);
103 return action;
104 }
87#ifdef MIDI_ENABLE 105#ifdef MIDI_ENABLE
88 } else if (keycode >= 0x6000 && keycode < 0x7000) { 106 } else if (keycode >= 0x6000 && keycode < 0x7000) {
89 action_t action; 107 action_t action;