Guides and Sample Code

Developer

macOS Human Interface Guidelines

iBooks
On This Page

Keyboard Shortcuts

macOS reserves several key combinations for use with localized versions of system software, localized keyboards, keyboard layouts, and input methods. These key combinations (listed in Table 72-1) don’t correspond directly to menu commands.

Table 72-1Key combinations reserved for international systems

Key combination

Action

Command–Space bar

Rotate through enabled script systems

Option–Command–Space bar

Rotate through keyboard layouts and input methods within a script

modifier key–Command–Space bar

Apple reserved

Command–Right Arrow

Change keyboard layout to current layout of Roman script

Command–Left Arrow

Change keyboard layout to current layout of system script

Providing Keyboard Shortcuts

Keyboard shortcuts can provide an easy way for sophisticated users to perform actions, but don’t feel that you must create a shortcut for every command. If you can’t find a unique and easy-to-use keyboard shortcut for a command, don’t use one at all; keep in mind that users may have difficulty pressing multiple modifier keys anyway.

Avoid creating a shortcut by adding a modifier key to an existing shortcut, unless the shortcuts are related. For example, don’t use Shift-Command-Z as a keyboard shortcut for a command that is unrelated to Undo. Using Shift-Command-Z for Redo is appropriate, but using it for something like Calculate or Check Mail is confusing.

As much as possible, use the Command key as the main modifier key in a keyboard shortcut. For example, Command-P uses Command to modify the P key. For a command that complements another more common command, you can add Shift to the shortcut. For example, the shortcut for the complementary Page Setup command adds Shift to the shortcut for Print to give Shift-Command-P. Table 72-2 gives additional examples of this technique.

Table 72-2Examples of keyboard shortcuts that use Shift to complement other commands

Complementary command shortcut

Complementary command

Complemented command shortcut

Shift-Command-A

Deselect All

Command-A (Select All)

Shift-Command-G

Find Previous

Command-G (Find Again)

Shift-Command-P

Page Setup

Command-P (Print)

Shift-Command-S

Save As

Command-S (Save)

Shift-Command-V

Paste as (Paste as Quotation, for example)

Command-V (Paste)

Shift-Command-Z

Redo (when Undo and Redo are separate commands rather than toggled using Command-Z)

Command-Z (Undo)

Use the Option key sparingly. If there’s a third, less common command that’s related to a pair of commands that use Command and Shift-Command, you can use Option-Command for the third command’s keyboard equivalent. Use combinations like these very rarely. You can also use Option for a keyboard shortcut that’s a convenience or power-user feature. For example, the Finder uses Option-Command-W for Close All Windows and Option-Command-M for Minimize All Windows.

As much as possible, avoid using the Control key. Because the Control key is already used by some of the universal access features—as well as in Cocoa text fields where Emacs-style key bindings are often used—it should be used as a modifier key only when necessary.

List multiple modifier keys in the correct order. If you use more than one modifier key in a shortcut, always list them in this order: Control, Option, Shift, Command.

Identify a key with two characters by the lower character, unless Shift is part of the shortcut. For example, the keyboard shortcut for Hide Status Bar is Command-Slash (that is, Command-/). If the Shift key is part of the keyboard shortcut, identify the key by the upper of the two characters. For example, the keyboard shortcut for Help is Shift-Command-Question Mark, not Shift-Command-Slash.

Reserved and Recommended Keyboard Shortcuts

As you implement keyboard shortcuts in your app, use Table 72-3 to find:

  • Key sequences that are reserved by macOS.

    Users rely on these shortcuts to perform the specified actions no matter which app is currently running (these include shortcuts reserved for accessibility purposes). Don’t override these shortcuts.

  • Key sequences that are recommended for common app tasks.

    Users expect these shortcuts to mean the same thing from app to app. Provide these shortcuts if your app performs the associated tasks.

    If your app doesn’t perform the task associated with a recommended shortcut, think very carefully before you consider overriding it. Remember that although reassigning an unused shortcut might make sense in your app, your users are likely to know and expect the original, established meaning.

If a keyboard sequence isn’t listed in Table 72-3 you can use it for a frequently used command in your app, if a shortcut is appropriate. Be aware, however, that Apple may reserve other keyboard shortcuts in the future.

Table 72-3 groups together the primary key that is modified and variations of key sequences based on the primary key. In the interests of space, the table uses the following symbols to represent the modifier keys (these are the same symbols that menus display):

image: ../art/ks_control_2x.png

Control

image: ../art/ks_option_2x.png

Option

image: ../art/ks_shift_2x.png

Shift

image: ../art/ks_command_2x.png

Command

You should not override the shortcuts in Table 72-3 that are accompanied by the Apple symbol shown here, because macOS uses the shortcut in some way.

image: ../Art/ks_apple_icon_2x.png

Supporting a shortcut in Table 72-3 that isn’t accompanied by the Apple symbol is recommended for apps that perform the associated task.

Table 72-3Keyboard shortcuts in macOS

Primary key

Key sequence

Associated action

Space bar

image: ../art/ks_command_2x.png Space

image: ../art/ks_apple_icon_2x.png

Show or hide the Spotlight search field (when multiple languages are installed, may rotate through enabled script systems).

image: ../art/ks_shift_2x.png image: ../art/ks_command_2x.png Space

image: ../art/ks_apple_icon_2x.png

Apple reserved.

image: ../art/ks_option_2x.png image: ../art/ks_command_2x.png Space

image: ../art/ks_apple_icon_2x.png

Show the Spotlight search results window (when multiple languages are installed, may rotate through keyboard layouts and input methods within a script).

image: ../art/ks_control_2x.png image: ../art/ks_command_2x.png Space

image: ../art/ks_apple_icon_2x.png

Show the Special Characters window.

Tab

image: ../art/ks_shift_2x.png Tab

image: ../art/ks_apple_icon_2x.png

Navigate through controls in a reverse direction.

image: ../art/ks_command_2x.png Tab

image: ../art/ks_apple_icon_2x.png

Move forward to the next most recently used app in a list of open apps.

image: ../art/ks_shift_2x.png image: ../art/ks_command_2x.png Tab

image: ../art/ks_apple_icon_2x.png

Move backward through a list of open apps (sorted by recent use).

image: ../art/ks_control_2x.pngTab

image: ../art/ks_apple_icon_2x.png

Move focus to the next grouping of controls in a dialog or the next table (when Tab moves to the next cell). See Accessibility Programming Guide for OS X.

image: ../art/ks_control_2x.pngimage: ../art/ks_shift_2x.png Tab

image: ../art/ks_apple_icon_2x.png

Move focus to the previous grouping of controls. See Accessibility Programming Guide for OS X.

Esc

image: ../art/ks_option_2x.png image: ../art/ks_command_2x.png Esc

image: ../art/ks_apple_icon_2x.png

Open the Force Quit dialog.

Eject

image: ../art/ks_control_2x.png image: ../art/ks_command_2x.png Eject

image: ../art/ks_apple_icon_2x.png

Quit all apps (after giving the user a chance to save changes to open documents) and restart the computer.

image: ../art/ks_control_2x.png image: ../art/ks_option_2x.png image: ../art/ks_command_2x.png Eject

image: ../art/ks_apple_icon_2x.png

Quit all apps (after giving the user a chance to save changes to open documents) and shut the computer down.

F1

image: ../art/ks_control_2x.png F1

image: ../art/ks_apple_icon_2x.png

Toggle full keyboard access on or off. See Accessibility Programming Guide for OS X.

F2

image: ../art/ks_control_2x.png F2

image: ../art/ks_apple_icon_2x.png

Move focus to the menu bar. See Accessibility Programming Guide for OS X.

F3

image: ../art/ks_control_2x.png F3

image: ../art/ks_apple_icon_2x.png

Move focus to the Dock. See Accessibility Programming Guide for OS X.

F4

image: ../art/ks_control_2x.png F4

image: ../art/ks_apple_icon_2x.png

Move focus to the active (or next) window. See Accessibility Programming Guide for OS X.

image: ../art/ks_control_2x.pngimage: ../art/ks_shift_2x.png  F4

image: ../art/ks_apple_icon_2x.png

Move focus to the previously active window. See Accessibility Programming Guide for OS X.

F5

image: ../art/ks_control_2x.png F5

image: ../art/ks_apple_icon_2x.png

Move focus to the toolbar. See Accessibility Programming Guide for OS X.

image: ../art/ks_command_2x.png  F5

image: ../art/ks_apple_icon_2x.png

Turn VoiceOver on or off. See Accessibility Programming Guide for OS X.

F6

image: ../art/ks_control_2x.png  F6

image: ../art/ks_apple_icon_2x.png

Move focus to the first (or next) panel. See Accessibility Programming Guide for OS X.

image: ../art/ks_control_2x.pngimage: ../art/ks_shift_2x.png  F6

image: ../art/ks_apple_icon_2x.png

Move focus to the previous panel. See Accessibility Programming Guide for OS X.

F7

image: ../art/ks_control_2x.png F7

image: ../art/ks_apple_icon_2x.png

Temporarily override the current keyboard access mode in windows and dialogs. See Accessibility Programming Guide for OS X.

F8

image: ../art/ks_apple_icon_2x.png

Apple reserved.

F9

image: ../art/ks_apple_icon_2x.png

Apple reserved.

F10

image: ../art/ks_apple_icon_2x.png

Apple reserved.

F11

image: ../art/ks_apple_icon_2x.png

Show desktop.

F12

image: ../art/ks_apple_icon_2x.png

Hide or display Dashboard.

`(grave accent)

image: ../art/ks_command_2x.png `

image: ../art/ks_apple_icon_2x.png

Activate the next open window in the frontmost app. See Window Layering.

image: ../art/ks_shift_2x.png image: ../art/ks_command_2x.png `

image: ../art/ks_apple_icon_2x.png

Activate the previous open window in the frontmost app. See Window Layering.

image: ../art/ks_option_2x.png image: ../art/ks_command_2x.png`

image: ../art/ks_apple_icon_2x.png

Move focus to the window drawer.

- (hyphen)

image: ../art/ks_command_2x.png -

image: ../art/ks_apple_icon_2x.png

Decrease the size of the selected item (equivalent to the Smaller command). See The Format Menu.

image: ../art/ks_option_2x.png image: ../art/ks_command_2x.png-

image: ../art/ks_apple_icon_2x.png

Zoom out when screen zooming is on. See Accessibility Programming Guide for OS X.

{ (left bracket)

image: ../art/ks_command_2x.png{

Left-align a selection (equivalent to the Align Left command). See The Format Menu.

} (right bracket)

image: ../art/ks_command_2x.png}

Right-align a selection (equivalent to the Align Right command). See The Format Menu.

| (pipe)

image: ../art/ks_command_2x.png|

Center-align a selection (equivalent to the Align Center command). See The Format Menu.

: (colon)

image: ../art/ks_command_2x.png :

Display the Spelling window (equivalent to the Spelling command). See The Edit Menu.

; (semicolon)

image: ../art/ks_command_2x.png;

Find misspelled words in the document (equivalent to the Check Spelling command). See The Edit Menu.

, (comma)

image: ../art/ks_command_2x.png,

Open the app's preferences window (equivalent to the Preferences command). See The App Menu.

image: ../art/ks_control_2x.pngimage: ../art/ks_option_2x.png  image: ../art/ks_command_2x.png ,

image: ../art/ks_apple_icon_2x.png

Decrease screen contrast. See Accessibility Programming Guide for OS X.

. (period)

image: ../art/ks_control_2x.pngimage: ../art/ks_option_2x.png  image: ../art/ks_command_2x.png .

image: ../art/ks_apple_icon_2x.png

Increase screen contrast. See Accessibility Programming Guide for OS X.

? (question mark)

image: ../art/ks_command_2x.png ?

Open the app's Help menu. See The Help Menu.

/ (forward slash)

image: ../art/ks_option_2x.png image: ../art/ks_command_2x.png /

image: ../art/ks_apple_icon_2x.png

Turn font smoothing on or off.

= (equal sign)

image: ../art/ks_shift_2x.png image: ../art/ks_command_2x.png =

image: ../art/ks_apple_icon_2x.png

Increase the size of the selected item (equivalent to the Bigger command). See The Format Menu.

image: ../art/ks_option_2x.png image: ../art/ks_command_2x.png =

image: ../art/ks_apple_icon_2x.png

Zoom in when screen zooming is on. See Accessibility Programming Guide for OS X.

3

image: ../art/ks_shift_2x.png image: ../art/ks_command_2x.png 3

image: ../art/ks_apple_icon_2x.png

Capture the screen to a file.

image: ../art/ks_control_2x.pngimage: ../art/ks_shift_2x.png  image: ../art/ks_command_2x.png 3

image: ../art/ks_apple_icon_2x.png

Capture the screen to the Clipboard.

4

image: ../art/ks_shift_2x.png image: ../art/ks_command_2x.png 4

image: ../art/ks_apple_icon_2x.png

Capture a selection to a file.

image: ../art/ks_control_2x.pngimage: ../art/ks_shift_2x.png  image: ../art/ks_command_2x.png 4

image: ../art/ks_apple_icon_2x.png

Capture a selection to the Clipboard.

8

image: ../art/ks_option_2x.png image: ../art/ks_command_2x.png 8

image: ../art/ks_apple_icon_2x.png

Turn screen zooming on or off. See Accessibility Programming Guide for OS X.

image: ../art/ks_control_2x.pngimage: ../art/ks_option_2x.png  image: ../art/ks_command_2x.png 8

image: ../art/ks_apple_icon_2x.png

Invert the screen colors. See Accessibility Programming Guide for OS X.

A

image: ../art/ks_command_2x.png A

Highlight every item in a document or window, or all characters in a text field (equivalent to the Select All command). See The Edit Menu.

B

image: ../art/ks_command_2x.png B

Boldface the selected text or toggle boldfaced text on and off (equivalent to the Bold command). See The Edit Menu.

C

image: ../art/ks_command_2x.png C

Duplicate the selected data and store on the Clipboard (equivalent to the Copy command). See The Edit Menu.

image: ../art/ks_shift_2x.png image: ../art/ks_command_2x.png C

Display the Colors window (equivalent to the Show Colors command). See The Format Menu.

image: ../art/ks_option_2x.png image: ../art/ks_command_2x.png C

Copy the style of the selected text (equivalent to the Copy Style command). See The Format Menu.

image: ../art/ks_control_2x.png image: ../art/ks_command_2x.png C

Copy the formatting settings of the selected item and store on the Clipboard (equivalent to the Copy Ruler command). See The Format Menu.

D

image: ../art/ks_option_2x.png image: ../art/ks_command_2x.png D

image: ../art/ks_apple_icon_2x.png

Show or hide the Dock. See The Dock.

image: ../art/ks_control_2x.pngimage: ../art/ks_command_2x.png D

Display the definition of the selected word in the Dictionary app.

E

image: ../art/ks_command_2x.png E

Use the selection for a find operation. See The Edit Menu.

F

image: ../art/ks_command_2x.png F

Open a Find window (equivalent to the Find command). See The Edit Menu.

image: ../art/ks_option_2x.png image: ../art/ks_command_2x.png F

Jump to the search field control. See Search Field.

image: ../art/ks_control_2x.png image: ../art/ks_command_2x.png F

Enter full screen.

G

image: ../art/ks_command_2x.png G

Find the next occurrence of the selection (equivalent to the Find Next command). See The Edit Menu.

image: ../art/ks_shift_2x.png image: ../art/ks_command_2x.png G

Find the previous occurrence of the selection (equivalent to the Find Previous command). See The Edit Menu.

H

image: ../art/ks_command_2x.png H

Hide the windows of the currently running app (equivalent to the Hide AppName command). See The App Menu.

image: ../art/ks_option_2x.png image: ../art/ks_command_2x.png H

Hide the windows of all other running apps (equivalent to the Hide Others command). See The App Menu.

I

image: ../art/ks_command_2x.png I

Italicize the selected text or toggle italic text on or off (equivalent to the Italic command). See The Format Menu.

image: ../art/ks_command_2x.png I

Display an Info window. See Inspectors.

image: ../art/ks_option_2x.png image: ../art/ks_command_2x.png I

Display an inspector window. See Inspectors.

J

image: ../art/ks_command_2x.png J

Scroll to a selection.

M

image: ../art/ks_command_2x.png M

Minimize the active window to the Dock (equivalent to the Minimize command). See The Window Menu.

image: ../art/ks_option_2x.png image: ../art/ks_command_2x.png M

Minimize all windows of the active app to the Dock (equivalent to the Minimize All command). See The Window Menu.

N

image: ../art/ks_command_2x.png N

Open a new document (equivalent to the New command). See The File Menu.

O

image: ../art/ks_command_2x.png O

Display a dialog for choosing a document to open (equivalent to the Open command). See The File Menu.

P

image: ../art/ks_command_2x.png P

Display the Print dialog (equivalent to the Print command). See The File Menu.

image: ../art/ks_shift_2x.png image: ../art/ks_command_2x.png P

Display a dialog for specifying printing parameters (equivalent to the Page Setup command). See The File Menu.

Q

image: ../art/ks_command_2x.png Q

Quit the app (equivalent to the Quit command). See The App Menu.

image: ../art/ks_shift_2x.png image: ../art/ks_command_2x.png Q

image: ../art/ks_apple_icon_2x.png

Log out the current user (equivalent to the Log Out command).

image: ../art/ks_option_2x.pngimage: ../art/ks_shift_2x.png   image: ../art/ks_command_2x.png Q

image: ../art/ks_apple_icon_2x.png

Log out the current user without confirmation.

S

image: ../art/ks_command_2x.png S

Save a new document or save a version of a document. See The File Menu.

image: ../art/ks_shift_2x.png image: ../art/ks_command_2x.png S

Not used (legacy equivalent to the Save As command). See The File Menu.

T

image: ../art/ks_command_2x.png T

Display the Fonts window (equivalent to the Show Fonts command). See The Format Menu.

image: ../art/ks_option_2x.png image: ../art/ks_command_2x.png T

Show or hide a toolbar (equivalent to the Show/Hide Toolbar command). See The View Menu and Toolbars.

U

image: ../art/ks_command_2x.png U

Underline the selected text or turn underlining on or off (equivalent to the Underline command). See The Format Menu.

V

image: ../art/ks_command_2x.png V

Insert the Clipboard contents at the insertion point (equivalent to the Paste command). See The File Menu.

image: ../art/ks_option_2x.png image: ../art/ks_command_2x.png V

Apply the style of one object to the selected object (equivalent to the Paste Style command). See The Format Menu.

image: ../art/ks_option_2x.png image: ../art/ks_shift_2x.png image: ../art/ks_command_2x.png V

Apply the style of the surrounding text to the inserted object (equivalent to the Paste and Match Style command). See The Edit Menu.

image: ../art/ks_control_2x.png image: ../art/ks_command_2x.png V

Apply formatting settings to the selected object (equivalent to the Paste Ruler command). See The Format Menu.

W

image: ../art/ks_command_2x.png W

Close the active window (equivalent to the Close command). See The File Menu.

image: ../art/ks_shift_2x.png image: ../art/ks_command_2x.png W

Close a file and its associated windows (equivalent to the Close File command). See The File Menu.

image: ../art/ks_option_2x.png image: ../art/ks_command_2x.png W

Close all windows in the app (equivalent to the Close All command). See The File Menu.

X

image: ../art/ks_command_2x.png X

Remove the selection and store on the Clipboard (equivalent to the Cut command). See The Edit Menu.

Z

image: ../art/ks_command_2x.png Z

Reverse the effect of the user's previous operation (equivalent to the Undo command). See The Edit Menu.

image: ../art/ks_shift_2x.png image: ../art/ks_command_2x.png Z

Reverse the effect of the last Undo command (equivalent to the Redo command). See The Edit Menu.

image: ../art/ks_arrow_right_2x.png (right arrow)

image: ../art/ks_command_2x.png image: ../art/ks_arrow_right_2x.png

image: ../art/ks_apple_icon_2x.png

Change the keyboard layout to current layout of Roman script.

image: ../art/ks_shift_2x.png image: ../art/ks_command_2x.png image: ../art/ks_arrow_right_2x.png

image: ../art/ks_apple_icon_2x.png

Extend selection to the next semantic unit, typically the end of the current line.

image: ../art/ks_shift_2x.png image: ../art/ks_arrow_right_2x.png

image: ../art/ks_apple_icon_2x.png

Extend selection one character to the right.

image: ../art/ks_option_2x.pngimage: ../art/ks_shift_2x.png  image: ../art/ks_arrow_right_2x.png

image: ../art/ks_apple_icon_2x.png

Extend selection to the end of the current word, then to the end of the next word.

image: ../art/ks_control_2x.png image: ../art/ks_arrow_right_2x.png

image: ../art/ks_apple_icon_2x.png

Move focus to another value or cell within a view, such as a table. See Accessibility Programming Guide for OS X.

image: ../art/ks_arrow_left_2x.png (left arrow)

image: ../art/ks_command_2x.png image: ../art/ks_arrow_left_2x.png

image: ../art/ks_apple_icon_2x.png

Change the keyboard layout to current layout of system script.

image: ../art/ks_shift_2x.png image: ../art/ks_command_2x.png image: ../art/ks_arrow_left_2x.png

image: ../art/ks_apple_icon_2x.png

Extend selection to the previous semantic unit, typically the beginning of the current line.

image: ../art/ks_shift_2x.png image: ../art/ks_arrow_left_2x.png

image: ../art/ks_apple_icon_2x.png

Extend selection one character to the left.

image: ../art/ks_option_2x.pngimage: ../art/ks_shift_2x.png  image: ../art/ks_arrow_left_2x.png

image: ../art/ks_apple_icon_2x.png

Extend selection to the beginning of the current word, then to the beginning of the previous word.

image: ../art/ks_control_2x.png image: ../art/ks_arrow_left_2x.png

image: ../art/ks_apple_icon_2x.png

Move focus to another value or cell within a view, such as a table. See Accessibility Programming Guide for OS X.

image: ../art/ks_arrow_up_2x.png (up arrow)

image: ../art/ks_shift_2x.png image: ../art/ks_command_2x.png image: ../art/ks_arrow_up_2x.png

image: ../art/ks_apple_icon_2x.png

Extend selection upward in the next semantic unit, typically the beginning of the document.

image: ../art/ks_shift_2x.png image: ../art/ks_arrow_up_2x.png

image: ../art/ks_apple_icon_2x.png

Extend selection to the line above, to the nearest character boundary at the same horizontal location.

image: ../art/ks_option_2x.pngimage: ../art/ks_shift_2x.png  image: ../art/ks_arrow_up_2x.png

image: ../art/ks_apple_icon_2x.png

Extend selection to the beginning of the current paragraph, then to the beginning of the next paragraph.

image: ../art/ks_control_2x.png image: ../art/ks_arrow_up_2x.png

image: ../art/ks_apple_icon_2x.png

Move focus to another value or cell within a view, such as a table. See Accessibility Programming Guide for OS X.

image: ../art/ks_arrow_down_2x.png (down arrow)

image: ../art/ks_shift_2x.png image: ../art/ks_command_2x.png image: ../art/ks_arrow_down_2x.png

image: ../art/ks_apple_icon_2x.png

Extend selection downward in the next semantic unit, typically the end of the document.

image: ../art/ks_shift_2x.png image: ../art/ks_arrow_down_2x.png

image: ../art/ks_apple_icon_2x.png

Extend selection to the line below, to the nearest character boundary at the same horizontal location.

image: ../art/ks_option_2x.pngimage: ../art/ks_shift_2x.png  image: ../art/ks_arrow_down_2x.png

image: ../art/ks_apple_icon_2x.png

Extend selection to the end of the current paragraph, then to the end of the next paragraph (include the paragraph terminator, such as Return, in cut, copy, and paste operations).

image: ../art/ks_control_2x.png image: ../art/ks_arrow_down_2x.png

image: ../art/ks_apple_icon_2x.png

Move focus to another value or cell within a view, such as a table. See Accessibility Programming Guide for OS X.