Turn your MacBook eject key into a rimshot button

When I left Adobe, I returned my company laptop. Since then, I’ve been test-driving a borrowed Macbook Air from fellow Studiomate Skylar Challand (Canadians are so nice!). While using the laptop, I realized something strange—even though it lacks a disc drive, it still has an eject key. This is understandable because of the optional USB superdrive, but the last time I actually used a disc drive was to burn the MP3s I downloaded from Limewire.

Half-joking, I tweeted this:

Before the tweet could load, I knew I had to follow through. And within 15 minutes, I had a solution.

Disclaimer: There are probably dozens of easier ways to do this, but this is the first way that came to mind.

  1. Download KeyRemap4MacBook

    KeyRemap4MacBook is a free preference pane app. I would describe it, but it’s one of those apps that skips all the cutesy names and tells you exactly what it does.

  2. Map the eject key to F13

    Go to the KeyRemap4MacBook preference pane, search for ‘eject f13’ and check its box. I use F13 because, on my computer at least, it isn’t mapped to anything. map

  3. Download rimshot MP3 from instantrimshot.com

    If you haven’t been to instantrimshot.com, you aren’t telling enough jokes in the workplace. I ended up scrubbing the HTML to find the MP3 file, but you can just download it here.

  4. Create Alfred extension to play MP3 using afplay

    I skipped writing a step for downloading Alfred and purchasing the Powerpack because I assume you already have them. If not, 5 points taken from Gryffindor! Open the preferences and under ‘Extensions’, create a shell script as seen below. Ever since Leopard, OSX comes bundled with a binary called ‘afplay’ that lets you play audio files from the command line. Incredibly useful in this case. extension

  5. Create global hotkey for extension

    Lastly, go to the ‘Hotkeys’ tab and create a global hotkey for your shell script and map it to F13. hotkey

Try it out and let me know how it goes!