I recently rediscovered the hyper key on MacOS. Most suggestions remap caps lock to the hyper key, but I occasionally need caps lock ensure random people in the comments section know I’m yelling at them. This started my quest to figure out how to double tap shift to enable caps lock on MacOS.
The Hyper Key
On a Mac the Hyper key generally refers to a modifier button that acts as shift, control, option and command all at once. It basically gives you a modifier key for keyboard shortcuts that are unlikely to conflict with an application’s existing shortcuts. There are many ways to remap caps lock as a hyper key:
- BetterTouchTool added a hyper key as an option in a January 2021 release
- Karabiner-Elements has a prebuilt complex modification for a hyper key
- Hyperkey is a standalone app to add a hyper key. As a bonus you can use trackpad gestures to activate the hyper key.
Keeping Caps Lock
Adding the hyper key is the easy part, the harder part is retaining the ability to turn on caps lock. I decided I wanted to figure out a way to double tap shift to toggle caps lock to match the functionality on the iPhone keyboard.
The most complicated and most expensive option
After some searching with different keywords, I stumbled upon this Apple Discussion thread. There are instructions to compile a C/C++ executable that will turn caps lock on or off, toggle caps lock, or print the current caps lock state. The post is from 2015, but it still works on my Mac in 2021 (MacOS 11.6 at the time of writing).
In conjunction with Keyboard Maestro’s USB Device Key trigger, I was able to run a simple AppleScript that would run the capslock command with the appropriate argument capslock -1
.
While this works, there are some major downsides to this option. First, you’ll need Xcode (or at least Xcode command line tools) to compile the executable. It’s not a user friendly option (at least for the average user). Second, you’ll need a $36 Keyboard Maestro license. I already had a license because Keyboard Maestro is an awesome application, but it’s a bit steep if caps lock is the only reason you’re running it.
The easiest option
I kept searching for more options and stumbled upon the Shifted app. The site must have mediocre SEO because it was pretty far down the list of Google search results, but it did exactly what I needed. It allows you to double tap shift or press both shift keys to enable caps lock. It also allows you to remap the caps lock key, but a hyper key wasn’t one of the options. In conjunction with the Hyperkey app, this is probably the most straightforward way to add a hyper key and enable double shift caps lock.
My optimal option
Since I already use Karabiner-Elements to remap my caps lock key to a hyper key, I wanted to see if it was possible to do a double tap shift for caps lock in the same place. The very first result of my Google search was a GitHub issue with the answer. Honestly, if I was smarter I should have Googled this first and saved myself a ton of time.
I added the modification to the karabiner.json file (in the ~/.config/karabiner/
folder) and now I have a hyper key, and retained the ability to turn on caps lock all through a single app.