A few years back at the predecessor of this blog1 I had a post on making a master meta key. It was largely inspired by a blog post by Brett Terpstra and also Dr. Drang. I’d just refer people To Brett’s great post but it’s a tad dated at this stage. For instance the applications he mentioned have been renamed. Since having a master meta key is so great, here’s an updated version of my old post.
I use a lot of macros and it’s nice to have keys that don’t conflict with the application. Its also nice to have memorable keys so you can actually remember what your shortcuts are.2 Mainly I just hate my caps lock key and wanted to make it more functional.
The general idea is that when you press your caps lock you generate the ⌘⌥⇧⌃ combination. That’s a hard combination of keys to type so it’s almost always a key combination left unused. Typically the really good mnemonic characters are already used.3 Now you can use them for custom macros and actually remember your key combination.
Next go to the system’s Keyboard System Preference and click on the button “Modifier Keys…” at the bottom of the window. Set the Caps Lock to No Action.
Next open Seil, click the “Change the caps lock key” arrow and change the key to keycode 80.5
Finally open Karabiner and click on the Misc & Uninstall tab. Click on “Open private.xml” which will open a Finder window displaying Karabiner’s xml file.
Open the file private.xml in your text editor of choice.6 For me my file is fairly simple.
<?xml version="1.0"?> <root> <item> <name>F19 to F19</name> <appendix>(F19 to Hyper (ctrl+shift+cmd+opt) + F19 Only, send escape)</appendix> <identifier>private.f192f19_escape</identifier> <autogen> --KeyOverlaidModifier-- KeyCode::F19, KeyCode::COMMAND_L, ModifierFlag::OPTION_L | ModifierFlag::SHIFT_L | ModifierFlag::CONTROL_L, KeyCode::ESCAPE </autogen> </item> </root>
Go back to Karabiner, click on the “Change Key” tab and then the “Reload XML” button. You should now see something like the following.
Your caps lock should now function as a master meta key. Open up Keyboard Viewer and when you press the caps lock key you should see all the other modifier keys as down. You can now assign shortcuts in Keyboard Maestro using the caps lock key instead of just the control key or command key.
- While I had a backup of the blog, the database format Word Perfect used had changed meaning I couldn’t easily restore the data at the new site. I’m sure it was the sort of thing that had I worked at it I could have fixed. However at the time I didn’t have much time and now I have enough posts here that it’d be a bit of a pain. Every now and then I have some ask where some post they linked to went. I can but say sorry. Most of the scripts are still up at GitHub though. ↩
- If you use Keyboard Maestro a good tip is to both create a hotkey and a status menu item. Then you can look at the status menu to remember your keystroke. ↩
- Things like S for Save or R for Repost. With the Caps Lock key you can have both ⇪S and your previous ⌘S with no conflict. I often will have a custom ⇪V for doing a special paste. ↩
- They used to be known as KeyRemap4MacBook and PCKeyboardHack. I’m glad they renamed it since the old names meant people thought they were just for MacBooks or PCs. However the renaming means that a lot of people were confused looking at old instructions for turning their caps lock into a meta key. ↩
- Keycodes represent the actual keys on your keyboard. In this case it represents F19 which is not apt to be used. If you do happen to have a keyboard with 20 function keys you can map it to something else. ↩
- For me that’s BBEdit. So long as it saves as plain text any editor should do. ↩
- 40Gave uses Keyboard Maestro to map caps lock to a right click.