Eject key hacking for fun and profit

A while back, I wrote about how you can make the Caps Lock key actually do something useful. Today, I’ll do the same thing with the Eject key.

Now, granted, the Eject key isn’t quite as useless as Caps Lock, since it is the easiest way to get a disc out of your SuperDrive. However, and I don’t know about you, but I haven’t been putting very many discs in there lately that need ejecting. So, today I decided that I would make the Eject key do something much more helpful: eject external drives.

The process for doing this is fairly simple, and uses tools from the same people who made the one used in the Caps Lock article. So, let’s get started!

Step #1: Download KeyRemap4MacBook and NoEjectDelay.
KeyRemap4MacBook
is a preference pane which allows you to do all kinds of fun stuff to your keyboard. You should play with some of the other options after setting this up, it’s very powerful. NoEjectDelay is a simple utility that removes the need to hold the Eject key for a couple seconds for it to work. This one is optional.

Install at least KeyRemap, then reboot as directed.

Step #2: Download the script and make it a hotkey.
To eject all external disks, we’ll be using a simple AppleScript, which you can download here. Save it somewhere where it can live permanently. Now, you’ll need to set it up as a hotkey in your launcher of choice, I’ll be covering Alfred.

To set up a custom hotkey in Alfred, open the Alfred preferences. Go to the Features tab, and then Global Hotkeys. Click the [+] button, and set the Hotkey to Shift+Control+Option+Command+E. Set the Action to the path where you saved the script.

Step #3: Remap the Eject key.
Alright, we’re almost there. The last thing you have to do is remap the Eject key to the key combination you entered in the Hotkey field. We’re using that shortcut simply because it’s one of the options built into KeyRemap4MacBook. So, open up the newly installed preference pane, and type “Eject to Command” (without the quotes) into the search box. Once it filters the options, check the one that says “Eject to Command+Control+Option+Shift+E”.

Step #4: Profit!
Congratulations, you can now eject all of your drives by hitting the Eject key! This is especially useful with laptops, so you can quickly undock and leave your desk. When you actually do need to eject optical media, you can simply hit Fn+Eject. Enjoy, and thanks for reading!