Keyboard Control

Mountain Lion offers a fantastic feature for anyone who believes life is too short: keyboard-controllable menus, dialog boxes, pop-up menus, and even Dock pop-up menus. You can operate every menu in every program without the mouse.

In fact, you can operate every control in every dialog box from the keyboard, including pop-up menus and checkboxes. And you can even redefine many of the built-in OS X keystrokes, like Shift-⌘-3 to capture the screen as a graphic.

In fact, you can even add or change any menu command in any program. If you’re a keyboard-shortcut lover, your cup runneth over.

Here are some of the ways you can control your Mac mouselessly. In the following descriptions, you’ll encounter the factory settings for the keystrokes that do the magic—but as you’ll see in a moment, you can change these key combos to anything you like. (The System Preferences→Keyboard→Keyboard Shortcuts tab contains the on/off switches for these features.)

Note

On modern-day aluminum keyboards, the keystrokes described below may not work unless you also press the Fn key simultaneously.

If that seems just a tad clumsy, then you can eliminate the Fn-key requirement either by using the “Use all F1, F2, etc. keys as standard function keys” option described in the box on A Tedious Side Note about the Aluminum Apple Keyboards—or by choosing a different keystroke altogether (Control Menulets).

Control the Menus

When you press Control-F2, the menu is highlighted. At this point, you can “walk” to another menu by pressing the ← or → keys (or Tab and Shift-Tab). When you reach the menu you want, open it by pressing ↓, space, Return, or Enter.

Walk down the commands in the menu by pressing ↑ or ↓, or jump directly to a command in the menu by typing the first couple of letters of its name. Finally, “click” a menu command by pressing Enter, Return, or the space bar.

You can also close the menu without making a selection by pressing Esc or ⌘-period.

Control the Dock

Once you’ve pressed Control-F3, you can highlight any icon on the Dock by pressing the appropriate arrow keys (or, once again, Tab and Shift-Tab).

Then, once you’ve highlighted a Dock icon, you “click” it by pressing Return or the space bar. Again, if you change your mind, press Esc or ⌘-period.

Tip

Once you’ve highlighted a disk or folder icon, you can press the ↑ or ↓ keys to make its shortcut menu appear. (If you’ve positioned the Dock vertically, use ← or → instead.)

Cycle Through Your Windows

Every time you press Control-F4, you bring the next window forward, eventually cycling through every window in every open program. Add the Shift key to cycle through them in the opposite order.

You may remember that OS X offers a different keystroke for cycling through the different windows in your current program (it’s ⌘-~, the tilde symbol at the upper left on your keyboard). Control-F4, on the other hand, tours all windows in all programs. Both keystrokes are useful in different situations.

Control the Toolbar

This one is on the unpredictable side, but it more or less works in most programs that display an OS X–style toolbar: the Finder, System Preferences, and so on.

When you press Control-F5, you highlight the first button on that toolbar. Move the “focus” by pressing the arrow keys or Tab and Shift-Tab. Then tap Return or the space bar to “click” the highlighted button.

Control Tool Palettes

In a few programs that feature floating tool palettes, you can highlight the frontmost palette by pressing Control-F6. At this point, use the arrow keys to highlight the various buttons on the palette. You can see the effect when, for example, you’re editing text in TextEdit and you’ve also opened the Font palette. Pressing Control-F6 highlights the Font palette, taking the “focus” off your document.

Control Menulets

Here’s a gem you may not have heard about: You can operate menulets—those menu-bar status indicators for your speaker volume, wireless networks, and so on—from the keyboard, too.

This time, the trick is to hit Control-F8. That highlights the leftmost Apple menulet. Now you can use your ← and → arrow keys to move around the menu bar; when you’ve highlighted the one you want, press Return or the space bar to “click” that menu and open it.

Control Dialog Boxes

You can also navigate and manipulate any dialog box from the keyboard.

See the dialog box shown in Figure 4-20? If you turn on “All controls” at the bottom, then pressing the Tab key highlights the next control of any type, whatever it may be—radio button, pop-up menu, and so on. Press the space bar to “click” a button or to open a pop-up menu. Once a menu is open, use the arrow keys (or type letter keys) to highlight commands on it, and use the space bar to “click” your choice.

Changing a Menu Keyboard Shortcut

Suppose you love iPhoto (and who doesn’t?). But one thing drives you crazy: The Revert to Original command, which discards all the changes you’ve ever made since taking the photo, has no keyboard shortcut. You have to trek up to the menu bar every time you need that command.

This is why OS X lets you add keyboard shortcuts to menu commands that lack them—or change the commands in programs whose key assignments break with tradition. (It works in any program that uses the standard OS X menu software, which rules out older versions of Microsoft Office.) Here’s the routine:

  1. Choose System PreferencesKeyboard. Click the Keyboard Shortcuts tab, and then click Application Shortcuts in the left-side list.

    You’re shown a list of any keyboard assignments you’ve created so far.

  2. Click the button just beneath the list.

    The dialog box shown in Figure 4-20 appears.

  3. Indicate which program needs behavior modification.

    In this example, you’d choose iPhoto from the Application pop-up menu. (If the program’s name doesn’t appear in the pop-up menu, then choose Other; navigate to, and double-click, the program you want.)

  4. Carefully type in the name of the menu command whose keyboard shortcut you want to change or add.

    Type it exactly as it appears in the menu, complete with capitalization and the little ellipsis (…) that may follow it. (You make the ellipsis character by pressing Option-semicolon.)

  5. Click in the Keyboard Shortcut box. Press the new or revised key combo you want.

    For example, press Control-R for iPhoto’s Revert to Original command. You’ll see the Mac’s notation of your keystroke appear in the Keyboard Shortcut box—unless, of course, the combo you selected is already in use within that program. In that case, you hear only an error sound that means, “Try again.”

    If you choose All Applications from the top pop-up menu, you can change the keyboard combo for a certain command wherever it appears. You could, for example, change the keystroke for Page Setup in every program at once. (Beware the tiny yellow triangles; they let you know if a chosen keystroke conflicts with another OS X keystroke.)

    Figure 4-20. If you choose All Applications from the top pop-up menu, you can change the keyboard combo for a certain command wherever it appears. You could, for example, change the keystroke for Page Setup in every program at once. (Beware the tiny yellow triangles; they let you know if a chosen keystroke conflicts with another OS X keystroke.)

  6. Click Add.

    The dialog box closes. By scrolling down in your Keyboard Shortcuts list, you see that the keystroke you selected has now been written down for posterity under the appropriate program’s flippy triangle. (To get rid of it, click its name and then click the button beneath the list.)

    The next time you open the program you edited, you’ll see that the new keystroke is in place.

Tip

To delete or change one of your custom menu shortcuts, open System Preferences→Keyboard→Keyboard Shortcuts. Click Application Shortcuts in the list at left. Click the command you’d like to edit. Press Delete to get rid of it; or, to try a different key combo, click where the existing keyboard shortcut appears and then press a new one.

Redefining a Keystroke

As you’ve no doubt become painfully aware, there are hundreds of keyboard combinations for the various OS X functions and settings. That’s good, because keyboard shortcuts are efficient and quicker than using the mouse. But that’s also bad, because there’s no way you’ll be able to remember all of them—and some of the most useful shortcuts are ridiculous, multikey affairs that you’ll never remember at all.

In the keyboard-shortcut center, shown in Figure 4-21, you can look over all the common OS X hidden keyboard functions—for Mission Control, Exposé, Spotlight, Dashboard, the Dock, and many others—and change them.

Here’s how it goes:

  1. Choose System Preferences. Click Keyboard. Click the Keyboard Shortcuts tab.

    You arrive at the dialog box shown in Figure 4-21.

  2. In the left-side list, click the category or function you want.

    Your choices include Launchpad & Dock, Mission Control, Keyboard & Text Input, and so on. When you click a category name, you see the available keyboard shortcuts.

    Tip

    You don’t have to be content with changing one of these keyboard shortcuts. You can also turn it off by clicking the corresponding checkbox. That’s great if one of Apple’s predefined keystrokes—for a function you don’t even use—is interfering with one in a program you like.

    The keyboard-shortcut center lets you redefine the keystrokes that trigger many basic OS X features, menu commands in your programs, and software you’ve built yourself using Automator, the Mac’s build-your-own software software.

    Figure 4-21. The keyboard-shortcut center lets you redefine the keystrokes that trigger many basic OS X features, menu commands in your programs, and software you’ve built yourself using Automator, the Mac’s build-your-own software software.

  3. Click the command you want to change. Then click the current keyboard combination.

    Suppose, for example, that you wish the Show Desktop Exposé keystroke were something easier to remember, like Control-D. So in step 2, you’d click Mission Control. In this step, you’d click Show Desktop. Then you’d click where it currently says “F11.”

  4. Press a new key combination.

    In this example, you’d press Control-D.

    Be careful, though. OS X keystrokes take precedence over all others. So if you choose a keystroke like ⌘-P for something, well, by golly, you’ll no longer be able to use ⌘-P to print anything in any of your programs. Think before you assign. Run a couple of tests afterward.

Get Switching to the Mac: The Missing Manual, Mountain Lion 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.