Browse Source

send KC_GRV if SHIFT or CTRL are held, but not both

massdrop-alt-monorail
Holly McFarland 3 months ago
parent
commit
682898972d
1 changed files with 14 additions and 0 deletions
  1. +14
    -0
      keyboards/massdrop/alt/keymaps/monorail/keymap.c

+ 14
- 0
keyboards/massdrop/alt/keymaps/monorail/keymap.c View File

@ -95,6 +95,20 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}
}
return false;
case KC_ESC:
// If SHIFT or CTRL are held, but not both, send KC_GRV
if ((MODS_SHIFT || MODS_CTRL) && !(MODS_SHIFT && MODS_CTRL)) {
if (record->event.pressed) {
register_code(KC_GRV);
}
return false;
}
// Release KC_GRV on keyup regardless of modifier keys, in case they were released first
if (!record->event.pressed) {
unregister_code(KC_GRV);
}
return true;
default:
return true; //Process all other keycodes normally
}


Loading…
Cancel
Save