summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBalz Guenat <balz.guenat@gmail.com>2017-08-11 18:53:08 +0200
committerBalz Guenat <balz.guenat@gmail.com>2017-08-11 18:53:08 +0200
commit7b8eed9f298e70a88742cefe5d75840160c75435 (patch)
tree9a0fb89677849dbfe1e673cbab6d3667af1352cf
parente966854a6542b0b7c021c0ab65f1409a0ca6c56f (diff)
downloadqmk_firmware-7b8eed9f298e70a88742cefe5d75840160c75435.tar.gz
qmk_firmware-7b8eed9f298e70a88742cefe5d75840160c75435.tar.xz
add option to let ctrl override shift/gui for the GRAVE_ESC.
This enables the ctrl+shift+esc shortcut to task manager on windows.
-rw-r--r--keyboards/bananasplit/keymaps/coloneljesus/config.h1
-rw-r--r--quantum/quantum.c5
2 files changed, 6 insertions, 0 deletions
diff --git a/keyboards/bananasplit/keymaps/coloneljesus/config.h b/keyboards/bananasplit/keymaps/coloneljesus/config.h
index 060f5922f..af6cf8ef1 100644
--- a/keyboards/bananasplit/keymaps/coloneljesus/config.h
+++ b/keyboards/bananasplit/keymaps/coloneljesus/config.h
@@ -20,5 +20,6 @@
#include "../../config.h"
// place overrides here
+#define GRAVE_ESC_CTRL_OVERRIDE
#endif
diff --git a/quantum/quantum.c b/quantum/quantum.c
index 1f8ce6c46..8f8cec484 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -475,6 +475,11 @@ bool process_record_quantum(keyrecord_t *record) {
void (*method)(uint8_t) = (record->event.pressed) ? &add_key : &del_key;
uint8_t shifted = get_mods() & ((MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)
|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)));
+
+#ifdef GRAVE_ESC_CTRL_OVERRIDE
+ if (get_mods() & (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)))
+ shifted = 0;
+#endif
method(shifted ? KC_GRAVE : KC_ESCAPE);
send_keyboard_report();