4 of 131 min

2) A layer on Space: tap = space, hold = F18

This is my basic layer and one of the most successful in terms of ergonomics.

The logic is simple: space stays space, and holding space turns into a “mode service key” (in my case the virtual F18). Hammerspoon then listens for F18 and turns on the command layer.

Why Space: it’s in the centre of the keyboard and always under the thumb. It’s the most natural “mode button”, because the thumb is almost always free and easy to hold down without getting in the way of typing.

The key advantage of this approach is that it doesn’t break text input. I type as usual: a quick tap on space always gives a space. And when I need control, I just hold Space and get a temporary command layer that lives exactly as long as the hold is active.

The most important nuance here is hold timing. I retuned this layer and rewrote the JSON several times until I found a comfortable to_if_held_down_threshold_milliseconds value: so that the mode doesn’t turn on by accident while typing, but turns on instantly when needed.

I’m attaching the JSON with this modification.

Next I’ll go through how I build a command hierarchy through F17.

Series contents
  1. Keyboard layers
  2. Karabiner = a set of JSON rules
  3. 1) Caps Lock = Hyper
  4. 2) A layer on Space: tap = space, hold = F18
  5. 3) backtick hold = F17
  6. 4) Russian layout: targeted rules for Russian typing only
  7. Hammerspoon
  8. Window Manager in Hammerspoon
  9. Media control as scenarios in Hammerspoon
  10. Hammerspoon as a local server and a "remote control"
  11. Monitors and a stable workplace (Hammerspoon)
  12. A MIDI keyboard and OBS as a hardware controller (Hammerspoon)
  13. The topic of keyboard layers is closed for now