A Hyper Key is an extra modifier key that can be used to add extra keyboard shortcuts in tools such as hammerspoon. The most common method on a Mac was to use your Caps Lock key as your Hyper key using a tool called Karabiner Elements. The issue with Karabiner though is that it is a kernel extension and keeps running into problems with newer OS X releases. If your only use case for Karabiner is to remap the Caps Lock key - you may be able to use the OS X native hidutil utility to achieve the same result.

For example, the code below remaps the Caps Lock key to F18.

1
2
3
hidutil property --set \
 '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000039,
 "HIDKeyboardModifierMappingDst":0x70000006D}]}'

F18 can later on be used in hammerspoon as a modifier to bind to various functions.

The above hidutil setting does not persist after reboot - so it can be configured to be set at boot using launchctl

Put the xml below into ~/Library/LaunchAgents/com.local.KeyRemapping.plist

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.local.KeyRemapping</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/bin/hidutil</string>
        <string>property</string>
        <string>--set</string>
        <string>{"UserKeyMapping":[
            {
              "HIDKeyboardModifierMappingSrc": 0x700000039,
              "HIDKeyboardModifierMappingDst": 0x70000006D
            }
        ]}</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
</dict>
</plist>

There is also a handy generator located here in case you’d like to remap other keys.