120

On Windows based machines, whenever a dialogue box pops up with multiple choice options (ie 'Abort', 'Continue', 'Retry'), you can use the 'Tab' key to cycle through those options without using the mouse.

On OSX, there doesn't appear to be an option to cycle through dialogue boxes using a key rather than the Trackpad.

Is there any keyboard shortcut to do this?

tomdot
  • 1,408

5 Answers5

162

macOS provides functionality to cycle through dialog boxes, but there is a system setting that must be enabled.

Toggle Functionality with Keyboard Shortcut

Press Control-F7

System Settings (macOS Ventura and later)

Starting with macOS Ventura, the setting is in System Settings → Keyboard → Keyboard Navigation. Click the toggle to enable the setting.

System Settings Keyboard Navigation

System Preferences (macOS Monterey and earlier)

In macOS Monterey and earlier versions, the setting is in System Preferences → Keyboard → Shortcuts → Full Keyboard Access... → All Controls

System Preferences Full Keyboard Access


Keyboard Control Tips

example dialog

Now you can navigate dialogue boxes using the keyboard:

  • Press Tab to move the focus the next button on the dialog.
  • Press Shift-Tab to move back to the previous button.
  • Press Space to trigger the currently selected button (highlighted border).

Regardless of which control is currently selected:

  • Pressing Return will always trigger the default button (highlight-coloured button).
  • Pressing Esc will always cancel the dialog.
gentmatt
  • 49,722
  • 3
    This is the second part of the problem - I didn't have it enabled in the first place! – tomdot Jul 02 '12 at 10:37
  • 2
    On my Mac, running OS X 10.11, System Preferences informs me that this setting can be changed with control+F7. – Kenny Evitt Jul 16 '16 at 03:07
  • 2
    Ctrl+F7 to enable – James EJ Oct 22 '17 at 18:48
  • esc will choose cancel” is not reliably true any more.

    Sometimes it does. Mostly, it does not.

    – Dave Land May 03 '18 at 21:50
  • 1
    @DaveLand - According the Apple HIG: Include a Cancel button that responds to the standard cancelation keyboard shortcuts. A Cancel button provides a clear, safe way out of a dialog and returns the computer to the state it was in before the dialog appeared. Make sure the keyboard shortcut Command-period and the Esc (Escape) key are mapped to the Cancel button. – Glen Yates Sep 07 '18 at 20:58
  • @GlenYates Absolutely, that's the right thing to do. Would that more developers would follow the Apple HIG. More and more, I find that escape doesn't do anything in a dialog, even when a Cancel button is present. – Dave Land Sep 08 '18 at 03:46
  • I wish official documentation laid out the Tab vs. Enter distinction. Sites just talk about making tab cycle the choices... but not how to select a choice. Enter is the intuitive answer to "choose the thing currently highlighted." Thanks for this answer, it was driving me crazy to think I was choosing "Don't Save" and seeing the file save anyway! – Hendy May 12 '23 at 13:35
55

It is also the tab key. The difference to Windows is, that the "return" key always pushes the default button (which is the colored one). The currently selected button (which can be changed using the tab key) is marked through a colored border. If you'd like to push this button, you have to press the space bar.

For this to work you must have it enabled in System Preferences / Keyboard / Shortcuts

enter image description here

cyphorious
  • 1,865
  • 30
    Just remember that for this to work you must have it enabled in System Prefereces / Keyboard / Shortcuts – Thecafremo Jul 02 '12 at 09:47
  • 1
    downvoted the answer because it didn't work, then I upvoted the previous comment because that was the trick. – trusktr Jul 02 '18 at 19:27
  • 1
    It would be helpful if this answer had the setting name and location of what needs to be enabled. On the shortcut menu, you have to set the "Full Keyboard Access" to "All Controls" at the bottom of System Prefereces / Keyboard / Shortcuts menu – wattry Apr 29 '20 at 17:09
  • It used to be that you could hit command and the first letter of whatever button you wanted to press. Guess that is gone now? – rebusB Jul 08 '21 at 23:14
  • 3
    On Big Sur this option is called "Use keyboard navigation to move focus between controls". It's at the bottom of Keyboard > Shortcuts box. – Dmitry Shvedov Oct 11 '21 at 22:33
  • I don't know how to toggle this behavior on Ventura, but it seems to be enabled on my system. Where is it, so I know...? – hepcat72 Sep 11 '23 at 14:40
38

Enable focusing with tab key at  → System PreferencesKeyboardShortcutsFull Keyboard Access...All Controls

tab moves between buttons

space presses focused button (with blue outline)

return presses default button (with blue background)

+first letter on button presses that button (works sometimes)

+. cancels

esc cancels (works sometimes)

Dave Land
  • 325
  • 1
  • 4
  • 13
Pup
  • 666
20

MacOS Sonoma/Ventura

Turn on option at :

 → System Preferences → Keyboard → Keyboard Navigation

enter image description here

MacOS Monterey/BigSur/Catalina

check the checkbox at :

 → System Preferences → Keyboard → Shortcuts tab → Use keyboard navigation to move focus between controls

enter image description here

If the checkbox is already checked, uncheck it and check it again.

Sabrina
  • 390
  • 6
    While it was already checked for me. It only started working after I unchecked and checked it again. – Iggy Oct 31 '20 at 16:53
  • 4
    This is the same in Big Sur. – Neil Jan 25 '21 at 18:47
  • 2
    Sabrina and @Neil thank you! I can't believe that's not enabled by default. – Brian Mortenson Mar 13 '21 at 07:05
  • 1
    I wondered why it wasn't enabled by default but I've turned it off again now. Still multiple keyboard presses to get to the dialog save / dont save option, but it also causes lots of other annoyances like Outlook goes through a ton of toolbar options before you get from address to main window, and lots of other little situations like this. I just wanted to be able to press alt+n to say no to dialogs like in Windows, but this was only a partial solution with a lot of baggage. – rtpHarry Jul 01 '22 at 22:03
6

You can press Control+F7 (or fn+Control+F7 depending on your keyboard preferences regarding default function keys) to turn this option on/off on the fly.