arrow-left arrow-right brightness-2 chevron-left chevron-right facebook-box facebook loader magnify menu-down rss-box star twitter-box twitter white-balance-sunny window-close
Modify the default action of a keyboard shortcut
1 min read

Modify the default action of a keyboard shortcut

Based on a couple of conversations I’ve had in the last month, it seems most people think that if a keyboard shortcut is already taken by an application, then you can’t use that shortcut within the application for something other than what the developers originally intended.

This is wrong, and getting around it couldn’t be easier. You just need to assign a new keyboard shortcut to the action that’s currently assigned to the shortcut you want to use for another purpose, and then assign the old keyboard shortcut (i.e., the one you want to repurpose) to the new action you want it to invoke.

To illustrate this, I’ll use an example that comes up over and over again in my day-to-day use, namely CMD+P. As everyone knows, this is almost universally assigned to print functionality, but seriously, who the fuck prints anything these days? I like to use CMD+P for “preview”—mainly Markdown previews within whatever writing app I’m currently using.

To do this I simply go to System Preferences > Keyboard > Keyboard Shortcuts > Application Shortcuts, assign “Print” to some nonsensical keyboard shortcut, and then assign CMD+P to “Preview” (or whatever the particular app calls its preview functionality). (I can’t do this universally across all apps because most of them have a one-off name for their preview stuff, especially if they offer multiple preview options.)

(In many instances, the process actually is easier than I just described—you only have to add the new shortcut in System Preferences > Keyboard > Keyboard Shortcuts > Application Shortcuts, and then the original shortcut gets stripped automatically. Sometimes this works, sometimes it doesn’t; I can’t quite figure out the voodoo, and so I usually just go the two-step route described above.)

You've successfully subscribed to Justin Blanton.
Success! Your account is fully activated, you now have access to all content.