A Terrible Hyper Key Workaround for Sierra

UPDATE

Don't even bother with my solution: It sucks. Matt Petty has figured out how to completely replicate the Hyper key behavior (via Brett Terpstra)!

For years, I've remapped the caps lock to control-option-command-shift aka the Hyper Key. I used pqrs's Seil and Karabiner, and it was nifty.

With the release of macOS Sierra, private APIs have changed and irreparably broke Seil and Karabiner. Karabiner is in the process of being rewritten, but it will probably take several weeks. I've exhausted every possible alternative for key mapping, but without Karabiner, there is no good way to do this. This has been my main frustration through the Sierra beta.

With the help of Keyboard Maestro's ability to recognize the caps lock device key, I came up with an awkward macro to tide me over until Karabiner is ready. Let me be clear: This is NOT a key remapping, and it sucks. Because it requires two additional keystrokes, it's no good for launching Alfred or Launchbar as I usually like to do, but it might be OK for firing off more complex actions. Also, I think you'll need to copy the Macro for each keyboard you use.

Before you do anything, check out how much this sucks, and is probably a waste of your time:

As with Karabiner/Seil, you'll want to set the Caps Lock to "no action" in System Preferences:

I used JavaScript for Automation to execute the keyboard shortcut:

function getSubstring() {
    var kme = Application("Keyboard Maestro Engine");
    var input = kme.getvariable('Key');
    return input[0];
}

function executeCommand() {
    var se = Application('System Events')
    var key = getSubstring();
    se.keystroke(key, { using: [ 'option down', 'command down', 'shift down', 'control down' ] });
}
executeCommand();

Did you like this post? Are you smitten for Soundsmitten? Click the "Tweet" link below to retweet my post. It keeps my livelihood afloat, brightens my day, and I'm always eternally grateful. Thanks for your help!