13

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.

1
  • Mac OS X 10.6, aka Snow Leopard?
    – Alex
    Aug 14, 2010 at 13:27

4 Answers 4

15

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).

1
  • Is there a way to have the application or operating system show what the shortcuts are for a given dialog?
    – Sam
    Apr 19, 2023 at 0:49
6

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

full keyboard access

3
  • 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? Aug 14, 2010 at 21:51
  • 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
    Aug 15, 2010 at 4:41
  • Thanks for the answer and comments. I will try to adapt to NReilingh's proposal in his answer.
    – znq
    Aug 15, 2010 at 22:14
4

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.

0

Since Enter will only trigger the main action only, you probably want to know that Space is the key to trigger the current action (you can switch current action/highlight with Tab and Shift-Tab).

This makes it possible to trigger all actions from your keyboard without knowing their respective shortcuts.

You must log in to answer this question.

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