diff options
Diffstat (limited to 'quantum/quantum.c')
-rw-r--r-- | quantum/quantum.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/quantum/quantum.c b/quantum/quantum.c index 9232cf441..d08f15870 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c | |||
@@ -548,11 +548,34 @@ bool process_record_quantum(keyrecord_t *record) { | |||
548 | uint8_t shifted = get_mods() & ((MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT) | 548 | uint8_t shifted = get_mods() & ((MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT) |
549 | |MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI))); | 549 | |MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI))); |
550 | 550 | ||
551 | #ifdef GRAVE_ESC_ALT_OVERRIDE | ||
552 | // if ALT is pressed, ESC is always sent | ||
553 | // this is handy for the cmd+opt+esc shortcut on macOS, among other things. | ||
554 | if (get_mods() & (MOD_BIT(KC_LALT) | MOD_BIT(KC_RALT))) { | ||
555 | shifted = 0; | ||
556 | } | ||
557 | #endif | ||
558 | |||
551 | #ifdef GRAVE_ESC_CTRL_OVERRIDE | 559 | #ifdef GRAVE_ESC_CTRL_OVERRIDE |
552 | // if CTRL is pressed, ESC is always read as ESC, even if SHIFT or GUI is pressed. | 560 | // if CTRL is pressed, ESC is always sent |
553 | // this is handy for the ctrl+shift+esc shortcut on windows, among other things. | 561 | // this is handy for the ctrl+shift+esc shortcut on windows, among other things. |
554 | if (get_mods() & (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL))) | 562 | if (get_mods() & (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL))) { |
555 | shifted = 0; | 563 | shifted = 0; |
564 | } | ||
565 | #endif | ||
566 | |||
567 | #ifdef GRAVE_ESC_GUI_OVERRIDE | ||
568 | // if GUI is pressed, ESC is always sent | ||
569 | if (get_mods() & (MOD_BIT(KC_LGUI) | MOD_BIT(KC_RGUI))) { | ||
570 | shifted = 0; | ||
571 | } | ||
572 | #endif | ||
573 | |||
574 | #ifdef GRAVE_ESC_SHIFT_OVERRIDE | ||
575 | // if SHIFT is pressed, ESC is always sent | ||
576 | if (get_mods() & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) { | ||
577 | shifted = 0; | ||
578 | } | ||
556 | #endif | 579 | #endif |
557 | 580 | ||
558 | if (record->event.pressed) { | 581 | if (record->event.pressed) { |