You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
2.0 KiB

  1. # Grave Escape
  2. If you're using a 60% keyboard, or any other layout with no F-row, you will have noticed that there is no dedicated Escape key. Grave Escape is a feature that allows you to share the grave key (<code>&#96;</code> and `~`) with Escape.
  3. ## Usage
  4. Replace the `KC_GRV` key in your keymap (usually to the left of the `1` key) with `QK_GESC`. Most of the time this key will output `KC_ESC` when pressed. However, when Shift or GUI are held down it will output `KC_GRV` instead.
  5. ## What Your OS Sees
  6. If Mary presses `QK_GESC` on her keyboard, the OS will see an KC_ESC character. Now if Mary holds Shift down and presses `QK_GESC` it will output `~`, or a shifted backtick. Now if she holds GUI/CMD/WIN, it will output a simple <code>&#96;</code> character.
  7. ## Keycodes
  8. |Key |Aliases |Description |
  9. |-----------------|---------|------------------------------------------------------------------|
  10. |`QK_GRAVE_ESCAPE`|`QK_GESC`|Escape when pressed, <code>&#96;</code> when Shift or GUI are held|
  11. ### Caveats
  12. On macOS, Command+<code>&#96;</code> is by default mapped to "Move focus to next window" so it will not output a backtick. Additionally, Terminal always recognises this shortcut to cycle between windows, even if the shortcut is changed in the Keyboard preferences.
  13. ## Configuration
  14. There are several possible key combinations this will break, among them Control+Shift+Escape on Windows and Command+Option+Escape on macOS. To work around this, you can `#define` these options in your `config.h`:
  15. |Define |Description |
  16. |--------------------------|-----------------------------------------|
  17. |`GRAVE_ESC_ALT_OVERRIDE` |Always send Escape if Alt is pressed |
  18. |`GRAVE_ESC_CTRL_OVERRIDE` |Always send Escape if Control is pressed |
  19. |`GRAVE_ESC_GUI_OVERRIDE` |Always send Escape if GUI is pressed |
  20. |`GRAVE_ESC_SHIFT_OVERRIDE`|Always send Escape if Shift is pressed |