diff options
Diffstat (limited to 'quantum/quantum.c')
-rw-r--r-- | quantum/quantum.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/quantum/quantum.c b/quantum/quantum.c index 3329c1146..d17338871 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c | |||
@@ -143,7 +143,13 @@ void reset_keyboard(void) { | |||
143 | } | 143 | } |
144 | 144 | ||
145 | /* Convert record into usable keycode via the contained event. */ | 145 | /* Convert record into usable keycode via the contained event. */ |
146 | uint16_t get_record_keycode(keyrecord_t *record, bool update_layer_cache) { return get_event_keycode(record->event, update_layer_cache); } | 146 | uint16_t get_record_keycode(keyrecord_t *record, bool update_layer_cache) { |
147 | #ifdef COMBO_ENABLE | ||
148 | if (record->keycode) { return record->keycode; } | ||
149 | #endif | ||
150 | return get_event_keycode(record->event, update_layer_cache); | ||
151 | } | ||
152 | |||
147 | 153 | ||
148 | /* Convert event into usable keycode. Checks the layer cache to ensure that it | 154 | /* Convert event into usable keycode. Checks the layer cache to ensure that it |
149 | * retains the correct keycode after a layer change, if the key is still pressed. | 155 | * retains the correct keycode after a layer change, if the key is still pressed. |
@@ -169,6 +175,18 @@ uint16_t get_event_keycode(keyevent_t event, bool update_layer_cache) { | |||
169 | return keymap_key_to_keycode(layer_switch_get_layer(event.key), event.key); | 175 | return keymap_key_to_keycode(layer_switch_get_layer(event.key), event.key); |
170 | } | 176 | } |
171 | 177 | ||
178 | /* Get keycode, and then process pre tapping functionality */ | ||
179 | bool pre_process_record_quantum(keyrecord_t *record) { | ||
180 | if (!( | ||
181 | #ifdef COMBO_ENABLE | ||
182 | process_combo(get_record_keycode(record, true), record) && | ||
183 | #endif | ||
184 | true)) { | ||
185 | return false; | ||
186 | } | ||
187 | return true; // continue processing | ||
188 | } | ||
189 | |||
172 | /* Get keycode, and then call keyboard function */ | 190 | /* Get keycode, and then call keyboard function */ |
173 | void post_process_record_quantum(keyrecord_t *record) { | 191 | void post_process_record_quantum(keyrecord_t *record) { |
174 | uint16_t keycode = get_record_keycode(record, false); | 192 | uint16_t keycode = get_record_keycode(record, false); |
@@ -254,9 +272,6 @@ bool process_record_quantum(keyrecord_t *record) { | |||
254 | #ifdef LEADER_ENABLE | 272 | #ifdef LEADER_ENABLE |
255 | process_leader(keycode, record) && | 273 | process_leader(keycode, record) && |
256 | #endif | 274 | #endif |
257 | #ifdef COMBO_ENABLE | ||
258 | process_combo(keycode, record) && | ||
259 | #endif | ||
260 | #ifdef PRINTING_ENABLE | 275 | #ifdef PRINTING_ENABLE |
261 | process_printer(keycode, record) && | 276 | process_printer(keycode, record) && |
262 | #endif | 277 | #endif |