2

In many applications, Command-P is used to print. My fingers are accustomed to emacs settings and reflexively press Command-P not for printing but for browsing history. It's annoying to see the print pop-up window every time when I press Command-P. I don't need a shortcut to print.
How do you block a shortcut globally?

  • I'd call this more "system-wide" than "application-specific"... – NReilingh Nov 26 '13 at 4:08
2

This can be achieved by remapping the Print shortcut to a different shortcut that is out of the way, unused and unlikely to be pressed.

  1. Open System Preferences → Keyboard → Shortcuts → App Shortcuts.

  2. Click + to add a new shortcut.

  3. Application: All Applications

    Menu Title: Print… (that's a 'proper' ellipses by the way, use copy-paste if necessary)

    Keyboard Shortcut: Set it to something out of the way.

  4. Click Add.

Now, the Print command is set to a random keyboard shortcut, freeing up ⌘P.

0

You can also use defaults to change the shortcut to something like U+200B (ZERO WIDTH SPACE):

defaults write -g NSUserKeyEquivalents -dict-add Print... '\U200b'

nil would be triggered when pressing n in some applications like Audacity and \0 would be triggered when pressing any key in Safari in 10.9.

I use a shell script like this to configure the shortcuts:

defaults write -g NSUserKeyEquivalents '{
"Show Previous Tab"="~@\Uf702";
"Show Next Tab"="~@\Uf703";
"Minimize"="\U200b";
}'
defaults write com.apple.Finder NSUserKeyEquivalents '{
"Show Package Contents"="@\r";
}'
  • Thanks. That was a great tip. A note for dummies like me: it won't take effect until you relaunch the application. – honza Nov 26 '13 at 6:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .