Master Meta Key

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.

First off download the applications Karabiner and Seil.4 These are generally useful apps but we’ll be using them to modify things a bit.

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.

Keyboard Prefence

Next open Seil, click the “Change the caps lock key” arrow and change the key to keycode 80.5

Seil Caps Lock

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. 

Karabine Misc

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.

Karabiner Caps Lock

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.

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. For me that’s BBEdit. So long as it saves as plain text any editor should do.

Related Posts

  • 40
    Gave uses Keyboard Maestro to map caps lock to a right click.
    Tags: caps, click, lock, keyboard

5 thoughts on “Master Meta Key”

  1. I came across those old instructions for setting caps as Hyper key just a week or two ago; the newly renamed apps definitely threw me a bit; this would have been super nice to have! The hyperkey is a wonderful thing.

    I’ve got a question; how do I get a different behavior from a quick press on the caps key? Having it send escape throws me off sometimes. Is it as easy as just deleting the KeyCode::ESCAPE line in the xml file, or replacing it with something else?

    1. You know I’ve not really looked at it that closely so I’m not sure. But I’m not sure what you’re trying to do. You can change the keycode but again it depends upon what you’re trying to accomplish.

    1. Just don’t do the modifications in Karabiner and you can set the keyed to anything you want in Seil including some key. If you use Keyboard Maestro you can then associate a macro with that keycode. In this case, just keep it as F19 and assign F19 to either a Launchbar command or Keyboard Maestro macro.

      I should read up more on what Karabiner lets you do. It’s clearly powerful but most of my needs are just running macros so I do most of that in Keyboard Maestro.

Leave a Reply

Your email address will not be published. Required fields are marked *