aboutsummaryrefslogtreecommitdiff
path: root/quantum/quantum.c
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2019-11-28 21:59:59 +0000
committerGitHub <noreply@github.com>2019-11-28 21:59:59 +0000
commit2048df883200589c20dfc581e39e03703edf0b23 (patch)
treeeaef3f6d5d56fb0050b33a0fedc72063886e2aa2 /quantum/quantum.c
parent99f3321e2634547b57ec07f0d1d8b107670be824 (diff)
downloadqmk_firmware-2048df883200589c20dfc581e39e03703edf0b23.tar.gz
qmk_firmware-2048df883200589c20dfc581e39e03703edf0b23.zip
Compile out some keycode processing when features are disabled (#7506)
Diffstat (limited to 'quantum/quantum.c')
-rw-r--r--quantum/quantum.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/quantum/quantum.c b/quantum/quantum.c
index aaed6ce4e..f768f86bc 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -164,11 +164,6 @@ void reset_keyboard(void) {
164 bootloader_jump(); 164 bootloader_jump();
165} 165}
166 166
167/* true if the last press of GRAVE_ESC was shifted (i.e. GUI or SHIFT were pressed), false otherwise.
168 * Used to ensure that the correct keycode is released if the key is released.
169 */
170static bool grave_esc_was_shifted = false;
171
172/* Convert record into usable keycode via the contained event. */ 167/* Convert record into usable keycode via the contained event. */
173uint16_t get_record_keycode(keyrecord_t *record) { return get_event_keycode(record->event); } 168uint16_t get_record_keycode(keyrecord_t *record) { return get_event_keycode(record->event); }
174 169
@@ -281,6 +276,7 @@ bool process_record_quantum(keyrecord_t *record) {
281 case RESET: 276 case RESET:
282 reset_keyboard(); 277 reset_keyboard();
283 return false; 278 return false;
279#ifndef NO_DEBUG
284 case DEBUG: 280 case DEBUG:
285 debug_enable ^= 1; 281 debug_enable ^= 1;
286 if (debug_enable) { 282 if (debug_enable) {
@@ -288,6 +284,7 @@ bool process_record_quantum(keyrecord_t *record) {
288 } else { 284 } else {
289 print("DEBUG: disabled.\n"); 285 print("DEBUG: disabled.\n");
290 } 286 }
287#endif
291 return false; 288 return false;
292 case EEPROM_RESET: 289 case EEPROM_RESET:
293 eeconfig_init(); 290 eeconfig_init();
@@ -308,18 +305,16 @@ bool process_record_quantum(keyrecord_t *record) {
308 velocikey_toggle(); 305 velocikey_toggle();
309 return false; 306 return false;
310#endif 307#endif
311#ifdef PROTOCOL_LUFA 308#ifdef BLUETOOTH_ENABLE
312 case OUT_AUTO: 309 case OUT_AUTO:
313 set_output(OUTPUT_AUTO); 310 set_output(OUTPUT_AUTO);
314 return false; 311 return false;
315 case OUT_USB: 312 case OUT_USB:
316 set_output(OUTPUT_USB); 313 set_output(OUTPUT_USB);
317 return false; 314 return false;
318# ifdef BLUETOOTH_ENABLE
319 case OUT_BT: 315 case OUT_BT:
320 set_output(OUTPUT_BLUETOOTH); 316 set_output(OUTPUT_BLUETOOTH);
321 return false; 317 return false;
322# endif
323#endif 318#endif
324 } 319 }
325 } 320 }
@@ -590,6 +585,11 @@ bool process_record_quantum(keyrecord_t *record) {
590 break; 585 break;
591 586
592 case GRAVE_ESC: { 587 case GRAVE_ESC: {
588 /* true if the last press of GRAVE_ESC was shifted (i.e. GUI or SHIFT were pressed), false otherwise.
589 * Used to ensure that the correct keycode is released if the key is released.
590 */
591 static bool grave_esc_was_shifted = false;
592
593 uint8_t shifted = get_mods() & ((MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT) | MOD_BIT(KC_LGUI) | MOD_BIT(KC_RGUI))); 593 uint8_t shifted = get_mods() & ((MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT) | MOD_BIT(KC_LGUI) | MOD_BIT(KC_RGUI)));
594 594
595#ifdef GRAVE_ESC_ALT_OVERRIDE 595#ifdef GRAVE_ESC_ALT_OVERRIDE