Mac OS X 10.6: key to switch between selected button in a dialog window

10

4

If I have a dialog window in Mac OS X with multiple buttons, how can I switch the selection of the buttons? In Windows, Gnome, KDE, etc. it is usually with TAB.

Example dialog

In this example dialog I could simply press ESC, but there are other dialogs with more buttons.

znq

Posted 2010-08-14T13:20:39.357

Reputation: 213

Mac OS X 10.6, aka Snow Leopard? – Alex – 2010-08-14T13:27:29.560

Answers

14

I am going to go out on a limb here and propose that you're slightly confused, for this reason:

The highlighted blue button is not a selection like you've seen from Windows, KDE, and Gnome. It is simply what the developer has defined to be the default choice of the return/enter key. As loic wolff has shown, it is possible to enable tab selection of all controls, however this will likely slow you down in other areas simply from the sheer number of controls there are to tab through.

The right way to go about keyboard shortcuts for alternate dialog buttons is not tab, but command key combos. For example, Command-period is almost universally "cancel." You've already found that Esc also works for most things nowadays. It's often not documented, but the command shortcut for different buttons that aren't the default button or cancel is usually the first letter of that button (as stib mentioned). Example: if I quit without saving in a typical cocoa document-based application, I'll be presented with the following dialog box:

save prompt sheet

Return/enter will save, command-period or esc will cancel, and command-d will map to "Don't Save." The release of 10.6 from 10.5 made some fantastic improvements to the presence of these shortcuts in Finder and cocoa in general--almost all Finder dialogs will now respond in this fashion.


Update for 10.7+:

Apple's new paradigm for file versioning has changed the way the typical save dialog works. Now, "Don't Save" is mapped to command-delete, to symbolize deleting the "new" file you created (this is the equivalent shortcut to deleting a file from the Finder).

NReilingh

Posted 2010-08-14T13:20:39.357

Reputation: 5 539

5

You have to select All controls in the Keyboard prefpane. That way, you can select all your controls using Tab

full keyboard access

Loïc Wolff

Posted 2010-08-14T13:20:39.357

Reputation: 1 947

A related question occurs to me now. Why would Apple NOT make it the default for the Tab key to move the keyboard focus between all controls? Is it slightly harder to use the GUI in some cases if you go this route? – irrational John – 2010-08-14T21:51:59.820

If you've ever tried this, you'll learn that there are a LOT of controls--it just isn't practical to tab through all of them efficiently in a lot of cases, so Apple makes the default be the text boxes and lists. The option for all controls is mostly a universal access consideration. – NReilingh – 2010-08-15T04:41:04.830

Thanks for the answer and comments. I will try to adapt to NReilingh's proposal in his answer. – znq – 2010-08-15T22:14:37.943

3

tab key will often do it, and sometimes the splat key (AKA the command key) plus the first letter of the button you want.

This doesn't work on all dialogues though, there are some you have to explicitly hit with the mouse - for example the "program x is an appplication that you have downloaded from the internet, are you sure you want to run it" dialogue.

stib

Posted 2010-08-14T13:20:39.357

Reputation: 3 320