Created
September 11, 2018 01:24
-
-
Save arkag/a892819d993a423a2ee6b0a2fb52cadb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define MOD_GUI_MASK (MOD_BIT(KC_LGUI) | MOD_BIT(KC_RGUI)) | |
#define MOD_CTL_MASK (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)) | |
#define MOD_ALT_MASK (MOD_BIT(KC_LALT) | MOD_BIT(KC_RALT)) | |
#define MOD_SFT_MASK (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) | |
bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |
if (record->event.pressed) { | |
switch (keycode) { | |
case KC_ESC: | |
if (get_mods() & MOD_GUI_MASK) { | |
SEND_STRING(X_GRAVE); | |
} else if (get_mods() & MOD_SFT_MASK) { | |
SEND_STRING(X_TILDE); | |
} else { | |
return true; | |
} | |
return false; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment