Keyboard Shortcuts and a Hyper Key

September 7, 2021
Katamari Damacy image of a big rolling ball

Once you start getting serious about using the keyboard to navigate and automate more of your computing life, you first find yourself first desperately searching for unused key combinations to trigger your preferred actions.

Most Mac apps offer a large variety of built-in keyboard combinations already, and the simple ones are typically taken by core functionality - ⌘C for copy, ⌘V for paste, ⌘Q to quit and many more.

Out of necessity, you define more complicated combinations of Option, Control, Command and Shift plus a key. The larger modifier set you use, the better the likelihood that you won’t collide with an existing shortcut in your apps. For a long time, ⌃⌥⌘ + M was my go-to to maximize the size of the current window.

This works well, but as you add more combinations, it is hard to remember all of the defined key combinations and their meanings, and the number of keys required to activate them becomes annoying.

One Solution - The Hyper Key

Imagine we had a new modifier key on the keyboard AND we knew for a fact that that new modifier key wasn’t used by any existing keyboard shortcuts.

Call this new key Hyper. 1

With Hyper, our shortcuts no longer need multiple modifier keys just to avoid collisions with existing keyboard shortcuts - Hyper + M could maximize my window instead of the much harder to press ⌃⌥⌘ + M.

Implementing a Hyper Key on a Standard Keyboard

There’s two different approaches to implementing Hyper on a standard Mac.

  1. Change an existing key on your keyboard to emit three modifiers (e.g. Control-Option-Command) simultaneously. This is friendly for using out-of-the-box with other applications which may only understand the ‘standard’ modifier keys.
  2. Change an existing key on your keyboard to emit F19 or some other standard but rarely used key, then use that keypress as a new special ‘modifier’ key.

Both A Modern Space Cadet and A Hyper Key with Karabiner Elements are super useful posts (if a little dated), but I ended up using the second approach, a setup very similar to what’s described in Hammerspoon: A Better, Better Hyper Key

I used Karabiner Elements to modify the right-most Option Key. I rarely use this key which made it perfect to become Hyper. Some people use their Caps Lock key for this, but I prefer to map the Caps Lock key to Control.

Karabiner Elements Screenshot

Then I used Hammerspoon to setup the actual keyboard shortcut (_Hyper_+m). Hammerspoon has great support for custom hotkeys and keyboard shortcuts built-in.

--- In Hammerspoon init.lua

keyModal = hs.hotkey.modal.new({}, nil)

keyModal.pressed = function() 
	keyModal:enter()
end

keyModal.released = function() 
	keyModal:exit() 
end

hs.hotkey.bind({}, 'F19', keyModal.pressed, keyModal.released)

keyModal:bind({}, 'm', nil, function()
    local focused = hs.window.focusedWindow()
    hs.layout.apply({ {nil, focused, focused:screen(), hs.layout.maximized, 0, 0} })
end)

Now when you hold down Hyper (the right option key) + the m key together, the currently focused window gets maximized. The left Option key is unchanged and available to use as normal.

It is Great

Having a Hyper key has changed both the consistency of my custom keyboard shortcut set and made it significantly easier physically to activate them. It’s one of the best configuration changes I’ve made, and it’s one of the first things I setup on a new computer.


  1. Check out Lisp Machines and the Space-cadet keyboard - Wikipedia ↩︎