]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Added Grave Escape (#1391)
authorjamesofarrell <jofarrell@gmail.com>
Fri, 16 Jun 2017 21:56:50 +0000 (07:56 +1000)
committerskullydazed <skullydazed@users.noreply.github.com>
Fri, 16 Jun 2017 21:56:50 +0000 (14:56 -0700)
* 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+~

quantum/quantum.c
quantum/quantum_keycodes.h

index 4f4cee4e9b380219c745032540e0732a0ebe7a72..f5fb1e35c874c6dc537fc44b2feeeec7f214c2f5 100644 (file)
@@ -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;
index 7354ae0da1c61a27f6d9e87f1b94c966aafea53f..c34ecafa51039f8be7d58f2e6b070cef4b650634 100644 (file)
@@ -104,6 +104,7 @@ enum quantum_keycodes {
     MAGIC_UNHOST_NKRO,
     MAGIC_UNSWAP_ALT_GUI,
     MAGIC_TOGGLE_NKRO,
+    GRAVE_ESC,
 
     // Leader key
 #ifndef DISABLE_LEADER
@@ -514,6 +515,8 @@ enum quantum_keycodes {
 #define MACROTAP(kc) (kc | QK_MACRO | FUNC_TAP<<8)
 #define MACRODOWN(...) (record->event.pressed ? MACRO(__VA_ARGS__) : MACRO_NONE)
 
+#define KC_GESC GRAVE_ESC
+
 
 // L-ayer, T-ap - 256 keycode max, 16 layer max
 #define LT(layer, kc) (kc | QK_LAYER_TAP | ((layer & 0xF) << 8))