A Hyper Key with Karabiner Elements, full instructions

[Tweet : nvALT]

Yesterday I posted excitedly about full Hyper key functionality being available in macOS 10.12+. I included a snippet of a config file that has apparently led to some confusion, so I’m elaborating here on the full configuration.

The first thing you need is Karabiner Elements, and you need what is currently the bleeding edge version, 0.91.3. If you don’t already have Karabiner Elements installed, grab the latest version at pqrs.org/latest/karabiner-elements-latest.dmg. Open Karabiner Elements and go to the Misc tab, you can check your version and update if needed by clicking the “Check for beta updates” button.

Once it’s running, there’s a configuration file at ~/.config/karabiner/karabiner.json that you can edit. The options required for this are not available yet in the GUI, so they have to be added into this hidden config file.

The file is JSON, and breaking the formatting will cause Karabiner failure, so be sure to do any editing with care. Below is a complete version of my config file. It has no significant changes from the default other than the Hyper Key functionality. If you don’t have any other settings in Karabiner (e.g. Simple Modifications beyond one that, say, maps caps lock to something for Hammerspoon…), you can overwrite the contents of the karabiner.json with the code below.

If you do have other settings, you’ll need to follow different directions, so skip to the next part.

To edit just the Hyper key chunk into an existing config, you’ll add the chunk below into the “profiles” array in the first element:

Here’s the chunk that you’ll paste in. Be sure to keep the trailing comma after the last curly bracket.

Karabiner Elements should immediately detect the change and your Hyper Key should start working. You can test by going into any app that lets you assign keyboard shortcuts, such as BetterTouchTool, and adding or editing one. Holding down Caps Lock and hitting a key should give you the result ⌘⇧⌥⌃X. Hitting Caps Lock once should give you (Escape).

Note that you should be able to modify the Escape part of the key to maintain Caps Lock functionality by changing to “to_when_alone” value in the JSON to “caps_lock”. Then hitting Caps Lock with no other key should still allow it to function as normal.

If you have issues, be sure to check that in System Preferences->Keyboard->Modifier Keys you’ve disabled Caps Lock (set it to No Action). Note that if you use multiple keyboards (like the internal laptop one and an external Bluetooth one), that screen will have a dropdown where you’ll need to set this for each available keyboard. Also ensure that you don’t have any “simple modifications” set in Karabiner Elements that would be trapping the Caps Lock key.

Hopefully that’s a bit clearer…