Here’s a new Karabiner-Elements trick that I’ve been using to add home row app switching to my workflow. Tools like LeaderKey are great, but sometimes you just want the App Switcher, and sometimes you just want to be lazy with your fingers.
My goal was a home-row app switcher that triggered without leaving the home row, and didn’t steal keys for normal typing. The solution is a Karabiner-Elements complex modification that uses simultaneous key detection: the layer only activates when A and S are pressed together within a very short window (basically at the exact same time).
This modification is designed for the Keyboard Maestro app switcher, not the macOS default ⌘+⇥ switcher. Keyboard Maestro’s switcher uses Shift alone to move backward, whereas the system switcher expects ⇧+⌘+⇥; the key outputs below match KM’s behavior, so you’d need to adjust the modification (e.g. have D send ⇧+⇥) to use it with the built-in app switcher.
What it does
Hold A and S at the same time. While both are held, you get a temporary layer:
- D → previous app (Shift only; KM uses this for backward)
- F → next app (⌘+⇥)
- G → quit (⌘+Q)
So you chord A+S, then tap F, it loads the App Switcher, then tap D or F to move through the apps, or G to quit the highlighted app. Release A and/or S and switch to the highlighted app.
This works great with my home row arrow keys, allowing easy up/down/left/right navigation through Keyboard Maestro’s grid-based app switcher. Two-handed, but still all home row.
How it avoids hijacking A and S for regular typing
The modification never intercepts a lone A or S. It only triggers when both keys are pressed simultaneously, with a 50 ms threshold (basic.simultaneous_threshold_milliseconds). When you type normally, you press one key, release it, then press another. Your “a” and “s” key events are separated by hundreds of milliseconds, so Karabiner never sees them as a chord. Only an intentional A+S chord activates the layer. Single-key “a” and “s” pass through unchanged.
Under the hood, the rule uses Karabiner’s simultaneous from condition: an array of key codes that must all be pressed together. On that chord it sets a variable (as_layer) and injects left_command so that the following D/F/G rules (which are gated on as_layer) produce the right modifiers. When either A or S is released, to_after_key_up clears the variable and the layer drops. So you keep full use of A and S for typing; only the deliberate two-finger chord turns them into a layer key.
Import this modification
🔒
Premium Content
And More