• Skip to primary navigation
  • Skip to main content
Sal Ferrarello
  • About Sal Ferrarello
  • Speaking
  • Connect
    Mastodon GitHub Twitter (inactive)
You are here: Home / Computing / QMK 65% Esc and Backtick

QMK 65% Esc and Backtick

Last updated on August 24, 2021 by Sal Ferrarello

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 sent Esc

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).

Sal Ferrarello
Sal Ferrarello (@salcode)
Sal is a PHP developer with a focus on the WordPress platform. He is a conference speaker with a background including Piano Player, Radio DJ, Magician/Juggler, Beach Photographer, and High School Math Teacher. Sal can be found professionally at WebDevStudios, where he works as a senior backend engineer.

Share this post:

Share on TwitterShare on FacebookShare on LinkedInShare on EmailShare on Reddit
Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Computing, Draft, Solution Tagged With: qmk

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Copyright © 2023 · Bootstrap4 Genesis on Genesis Framework · WordPress · Log in