If you saw my note in yesterday’s web excursions about Karabiner Elements adding the necessary tools to recreate the Hyper Key, you might have gotten excited. If you’re like me, though, a major component of that trick was that if you hit the caps-lock key and nothing else, it functioned as the Escape key, and that part wasn’t working.

Go into Karabiner elements and hit “Check for beta upgrades,” and you’ll find an updated version (0.91.3 or higher), which adds a “to_if_alone” key to a manipulator config block. See the code below to enable the good old Hyper key with full Escape functionality.

Running 0.91.3 or higher, remove any existing reassignment of the Caps Lock key, then open up the configuration file at ~/.config/karabiner/karabiner.json in an editor. Add the block below, probably right below “simple_modifications” to make sure the nesting is correct. (If you already have a complex_modifications block, you’ll want to insert just the appropriate portion within that, not create a second block.)

karabiner.jsonraw
"
"complex_modifications": {
                "rules": [
                    {
                        "manipulators": [
                            {
                                "description": "Change caps_lock to command+control+option+shift. Escape if no other key used.",
                                "from": {
                                    "key_code": "caps_lock",
                                    "modifiers": {
                                        "optional": [
                                            "any"
                                        ]
                                    }
                                },
                                "to": [
                                    {
                                        "key_code": "left_shift",
                                        "modifiers": [
                                            "left_command",
                                            "left_control",
                                            "left_option"
                                        ]
                                    }
                                ],
                                "to_if_alone": [
                                    {
                                        "key_code": "escape",
                                        "modifiers": {
                                            "optional": [
                                                "any"
                                            ]
                                        }
                                    }
                                ],
                                "type": "basic"
                            }
                        ]
                    }
                ]
            },

Enjoy!