Karabiner-Elements
Back to System
Karabiner-ElementsAdvanced16 min

Karabiner-Elements Tutorial: Remap macOS Keyboard and Build a Hyper Key

Why Karabiner-Elements?

Karabiner-Elements remaps keys at the kernel level — before any app sees them. This means you can build a Hyper key (a single key that acts as Ctrl+Shift+Opt+Cmd), remap Caps Lock to Escape, or create layers that transform your keyboard entirely.

This guide covers installation, simple remaps, and building a full Hyper key setup that supercharges your shortcuts.

Installing & Granting Permissions

Install Karabiner-Elements from karabiner-elements.pqrs.org or via Homebrew:

brew install --cask karabiner-elements
Tip: After install, open Karabiner-Elements, go to Devices tab, and verify your keyboard is detected. Grant the security prompt.

Simple Key Remaps

Start with simple remaps in the Simple Modifications tab. Click "Add item", select a "from" key and a "to" key.

For each key, click the dropdown and pick the key. Changes apply instantly — no restart needed.

// Simple Modifications in config:
// caps_lock → escape
{ "from": {"key_code":"caps_lock"},
"to": [{"key_code":"escape"}] }

Building a Hyper Key

The Hyper key is the killer feature. It maps Caps Lock (or any key) to act as Ctrl+Shift+Opt+Cmd simultaneously — a modifier that no app uses, so you get conflict-free global shortcuts.

In Complex Modifications, add a rule: when Caps Lock is pressed alone, send Escape; when held with another key, send Hyper.

{
"description": "Caps Lock → Hyper + Escape",
"manipulators": [{
"from": { "key_code": "caps_lock" },
"to": [{
"key_code": "left_shift",
"modifiers": ["left_control","left_option","left_command"]
}],
"to_if_alone": [{ "key_code": "escape" }],
"type": "basic"
}]
}

Now any shortcut like Hyper+J works everywhere without conflicts. Pair it with Hammerspoon or Raycast for maximum power.

Complex Modifications & Layers

Karabiner's Complex Modifications are where the real power lives. Browse the pre-made rules at ke-complex-modifications.pqrs.org, or write your own.

Pro tip: Use the "Devices" tab to apply different rules to different keyboards. Your laptop keyboard and external mechanical keyboard can have entirely different mappings.

Key Conflict Diagnosis

Common issues and solutions:

Keyboard Superpower

You've built a Hyper key. Here's what's next:

← PreviousHammerspoon Window Management Guide: macOS Layouts and Snapping with LuaNext →Tmux Terminal Multiplexer Guide: Sessions, Panes, and Configuration