When I downsized to a 65% keyboard I knew I was giving up function keys and a number pad but what caught me off-guard was the loss of my backtick (a.k.a. grave accent (`
)) key.
I write a lot of markdown for programming issues which involves using the backtick for code
and for fenced code blocks. By default on my new keyboard I would have to hit Fn
+ Esc
every time I wanted a backtick.
First Attempt – Remapping
My new 65% keyboard runs QMK firmware, which allows me to map things however I want. My first attempt was to swap the Esc and the backtick behavior.
- Hitting
Esc
resulted in a backtick (`
) - Hitting
Fn
+Esc
sentEsc
This revealed to me that I use Esc
far more often than I realized (even though I prefer Ctrl+[
in Vim).
Phase Two (Tap Dance)
QMK has a feature called Tap Dance, which allows you to change the behavior of a key based on how many times you hit it. In my case, I wanted the following behaviors based on how many times I tapped the Esc
key.
- Once:
`
- Twice:
<Esc>
- Three times:
```
- Four times:
````
- etc.
My GitHub PR Implementing this Change
I have my Drop Alt QMK keyboard configuration in my Git repository (salcode/salcode-drop-alt). There you can see the pull request which Adds QMK Tap Dance to ESC/Backtick key.
Phase Three (Caps Lock)
Eventually, I decided the Tap Dance (different behavior based on how many times you tap the key) is not a final solution for me. While I’m keeping the Tap Dance behavior in place, I’ve now also mapped my Caps Lock key to Esc
(when tapped) and to Ctrl
when held down.
I did this using the QMK Mod-Tap functionality. The actual change in my keymap.c
was to replace KC_CAPS
with MT(MOD_LCTL, KC_ESC)
.
Next Steps?
I’m not sure I fore-see any further configuration changes around this problem but only time will tell (or perhaps I’ll buy a larger keyboard).
Leave a Reply