summaryrefslogtreecommitdiffstats
path: root/quantum/quantum.c
diff options
context:
space:
mode:
authorjamesofarrell <jofarrell@gmail.com>2017-06-16 23:56:50 +0200
committerskullydazed <skullydazed@users.noreply.github.com>2017-06-16 23:56:50 +0200
commit98316ef0170c6e0f994a45e1f62959ae0f278177 (patch)
tree7e1981d5966d09e1bd8c53cdeef0edb37a9dd0c1 /quantum/quantum.c
parentff2b01da49ccf2d57e61bb70cdbaacb40799299c (diff)
downloadqmk_firmware-98316ef0170c6e0f994a45e1f62959ae0f278177.tar.gz
qmk_firmware-98316ef0170c6e0f994a45e1f62959ae0f278177.tar.xz
Added Grave Escape (#1391)
* added QK_GRAVE_ESC and KC_GESC * fixed name * Fixed keycode emnu * Removed layer check, added left and right GUI mod detection for OSX GUI+~
Diffstat (limited to 'quantum/quantum.c')
-rw-r--r--quantum/quantum.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/quantum/quantum.c b/quantum/quantum.c
index 4f4cee4e9..f5fb1e35c 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -437,6 +437,14 @@ bool process_record_quantum(keyrecord_t *record) {
return false;
// break;
}
+ case GRAVE_ESC: {
+ 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)));
+
+ method(shifted ? KC_GRAVE : KC_ESCAPE);
+ send_keyboard_report();
+ }
default: {
shift_interrupted[0] = true;
shift_interrupted[1] = true;