Launching Alfred with Caps Lock

Caps Lock is stupid. It is the one key on my keyboard that I absolutely believe shouldn’t exist. For the past six months, it has been a dead key on my MacBook Pro, which is still better than it’s normal function. However, a dead key is a missed opportunity for awesomeness, so today I set out to make it do something useful. Namely, I wanted to use it to open my application launcher of choice, Alfred.

If you haven’t checked out Alfred, do it right now, before you read any further. Back? OK, good. Let’s move on.

Step #1: Download PCKeyboardHack.
PCKeyboardHack is a preference pane that allows you to remap Caps Lock, as well as both Control keys. I’m sure you can see where this is going. Install the package and reboot. On to step two!

Step #2: Download Key Codes.
Key Codes is a cool app that lets you press any key on the keyboard and get, amazingly enough, its key code!

Step #3: Pick an F-key, any F-key.
It doesn’t matter which one, as long as it isn’t being used for anything else. (Note: the special functions of the keys on an Apple keyboard, like volume, don’t count. We’re only concerned about the normal function of the key, accessed by holding Fn and pushing an F-key.) If you aren’t sure which keys are assigned to functions, check out System Preferences > Keyboard > Keyboard Shortcuts.
After you’ve chosen your favorite, open Key Codes, hold Fn if necessary, and press it. Key Codes will log a bunch of info about the key, but we’re only interested in the line that starts with “Key Code”. Remember the part of that line before the slash, you’ll need it later.

Step #4: Assign that key to open Alfred.
Open Alfred’s preferences, navigate to the General > Essential section, and set the hotkey to the F-key you just selected. Remember to hold Fn if you’re on an Apple keyboard.

Step #5: Remap the Caps Lock key.
Open System Preferences and open the PCKeyboardHack pane. Check “Change Caps Lock”, then double click on the number in the last column of it’s row. Change it to the number that you got from Key Codes in step three. Hit enter and leave System Preferences.

Step #6: Profit.
Hit your newly remapped Caps Lock key and rejoice, it’s no longer useless!

So, to recap: Alfred + Caps Lock = AWESOMENESS.
That is all.