Skip to content

Karabiner-Elements

Remaps any key to any key, builds layers, and applies different rules per keyboard.

Homebrew cask Direct download

What it does

Karabiner-Elements sits below the application layer, so its remappings apply everywhere including login and recovery-adjacent contexts. Beyond simple swaps it supports:

  • Complex modifications — conditional rules with JSON definitions, per-application or per-device.
  • Layers — hold a key to turn the alphabet into arrows, media keys or symbols.
  • Simultaneous keys and tap versus hold distinctions, so Caps Lock can be Escape when tapped and Control when held.
  • Per-device profiles, which is what makes an external PC keyboard and the built-in one behave consistently.

Karabiner-EventViewer ships alongside it and shows the raw key codes a device is actually sending — the first stop when a key does not do what a rule expects.

Notes

It installs a driver extension and needs Input Monitoring permission; on Apple Silicon expect one approval and a reboot at install. Rules live in ~/.config/karabiner/karabiner.json, which is worth keeping in a dotfiles repository.

Alternative to

AlternativeTypeTrade-off
HammerspoonOpen sourceLua scripting for the whole system, keyboard included
BetterTouchToolPaidBroader: trackpad gestures, window snapping, remapping
Keyboard MaestroPaidMacro-first rather than key-first, and very powerful
KanataOpen sourceThe same layer model as a cross-platform CLI daemon
QMK or ZMK firmwareOpen sourceRemapping in the keyboard itself, so it follows the hardware
System Settings → Keyboard → Modifier KeysBuilt inEnough for Caps Lock to Escape alone

Install

brew install --cask karabiner-elements

Links

This post is licensed under CC BY 4.0 by the author.
Last updated on