Redefining Keystrokes

If

Redefining Keystrokes

-S has never made sense to you as the keystroke for Save, or if some program you use has a menu command that lacks a keyboard equivalent altogether, this one is for you. Using the defaults command in Terminal (Chapter 15), you can easily massage whichever keystrokes you like—at least in any Cocoa program (Section 4.6).

Launch Terminal and type this command carefully, including the punctuation, precisely as shown here, taking care to substitute appropriate commands for those shown here in bold:

defaults write com.apple.Mail NSUserKeyEquivalents '{"Activity Viewer"="*a";}'

Here’s what to put in place of the bold elements above:

  • Mail. Type the name of the Cocoa program containing the menu command you want to change. (Mac OS X’s Cocoa programs include Stickies, Mail, Address Book, and TextEdit.)

  • Activity Viewer. Replace this with the wording of the command as it appears in the program’s menus.

  • *A. Replace these two characters with the keystroke you want to trigger the menu command from now on. Instead of the asterisk (*), however, type @ for the

    Redefining Keystrokes

    key, $ for the Shift key, ~ for the Option key, and ^ for the Control key. Follow these modifier stand-ins with the letter key you want. In other words, if you type $~D, you’ve just changed the keyboard equivalent of the menu ...

Get Mac OS X: The Missing Manual, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.