Created
August 28, 2018 18:04
-
-
Save arkag/52d11f9a98f6c2ce2efa93a87bace9d0 to your computer and use it in GitHub Desktop.
process_record_keymap function
This file contains hidden or 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
| bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { | |
| switch (keycode) { | |
| case TOG_OS: | |
| is_mac = ! is_mac; | |
| break; | |
| case M_GUI_CTRL: | |
| is_mac ? tap_key(KC_CTRL) : tap_key(KC_GUI); | |
| break; | |
| case M_CTRL_GUI: | |
| is_mac ? tap_key(KC_GUI) : tap_key(KC_CTRL); | |
| break; | |
| case KC_ESC: | |
| if (!record->event.pressed) { | |
| if ((get_oneshot_mods ()) && !has_oneshot_mods_timed_out ()) { | |
| clear_oneshot_mods (); | |
| } else { | |
| tap_key(KC_ESC); | |
| } | |
| } | |
| default: | |
| return true; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment