Keyboard input

Keyboards are a common way to interact with user interfaces. They provide a convenient and effective means to use applications in a variety of situations, and can be faster and more efficient than other input devices. Keyboards are also vital for visually-impaired people or those with mobility impairments.

You should ensure that all the functionality provided by your application can be accessed using a keyboard. Trying to use your application with only a keyboard is a great way to test this.

Keyboard interaction has three aspects in GNOME and GTK: navigation, access keys, and shortcut keys. Search is another, additional aspect.

Keyboard navigation

Make sure that it is possible to move around and interact with every part of your user interface using the keyboard, by following these guidelines.

  • Follow the standard GNOME keys for navigation. Tab is the standard key for moving around an interface with GTK and GNOME.

  • Use a logical keyboard navigation order. When navigating around a window with Tab, keyboard focus should move between controls in a predictable order. In Western locales, this is normally left to right and top to bottom.

  • In addition to navigation using Tab, make an effort to allow movement using the arrow keys, both within user interface elements (such as lists, icon grids or sidebars), and between them.

If activating a control enables other controls, do not automatically give focus to the first dependent control when it is activated, but instead leave focus in place.

Access keys

Access keys allow someone to operate labelled controls by using Alt. They are indicated by an underlined letter within each control label (this is displayed when Alt is held down).

  • Where possible, all labelled components should have an access key.

  • Choose access keys that are easy to remember. Normally this means using the first letter of the label. If the label has more than one word, the first letter of one of its other words can also be used. Additionally, if another letter provides a better association (for example: “x” in “Extra Large”) , consider using that letter instead.

  • Avoid assigning access keys to “thin” letters (such as lowercase i or l), or letters with descenders (such as lowercase g or y), unless it is unavoidable. The underline is sometimes not as clear with these characters.

  • If the choice of access keys is difficult, assign access keys to the most frequently-used controls first. If the first letter is not available, choose an easy to remember consonant from the label, for example, “p” in “Replace”. Only assign vowels once no consonants are available.

  • Be aware that access keys have to be translated together with the strings that they are taken from, so even if there are no conflicts in your native language, they may occur in translations.

Shortcut keys

Shortcut keys provide convenient access to common operations. They can be either single keys or combinations of several key presses (typically a modifier in combination with a regular key)

  • Do not assign system-level shortcut keys for use in your application. See below for details on these.

  • Use the standard GNOME shortcut keys (see below) if your application supports those functions. This ensures consistency between GNOME applications and aids discoverability.

  • Assign shortcut keys to the most commonly-used actions in your application. However, do not try to assign a keyboard shortcut to everything.

  • Try to use Ctrl in combination with a letter for your own shortcuts. Shift+Ctrl and a letter is the recommended pattern for shortcuts that reverse or extend another function. For example, Ctrl+Z and Shift+Ctrl+Z for Undo and Redo.

  • New shortcut keys should be as mnemonic as possible, as these will be easier to learn and remember. For example, Ctrl+E would be a good shortcut for a menu item called Edit Page.

  • Shortcuts that can be easily used with one hand are preferable for common operations.

  • Do not use Alt for shortcut keys, as this may conflict with access keys.

System reserved shortcuts

The following system shortcuts should not be overridden by applications.

GNOME 3 makes exclusive use of Super, often known as the windows key, for system shortcuts. Super should not be used by applications, therefore.

Function

Shortcut

Legacy Shortcut

Description

Activities Overview

Super

None

Opens and closes the Activities Overview

Applications View

Super+A

None

Opens and closes the applications view of the Activities Overview

Message Tray

Super+M

None

Toggles the visibility of the Message Tray.

Lock

Super+L

None

Locks the system by blanking the screen and requiring a password to unlock, if one has been set.

Switch application

Super+Tab and Shift+Super+Tab

Alt+Tab and Shift+Alt+Tab

Switches focus to the next/previous application

Switch windows

Super+` and Shift+Super+`

Alt+F6 and Shift+Alt+F6

Switch focus to the next or previous secondary window associated with the application

Maximize

Super+

Alt+F10

Maximize the focused window

Restore

Super+

Alt+F5

Restores the focused window to its previous state

Hide

Super+H

Alt+F9

Hide the focused window

Switch system area

None

Ctrl+Alt+Tab and Shift+Ctrl+Alt+Tab

Switches focus to the primary areas of the system: windows, top bar, message tray

Power Off

None

Ctrl+Alt+Delete

Prompts the user to power off the system. This shortcut is typically disabled by default.

Window menu

Alt+Space

None

Opens the window menu for the current window

Close

None

Alt+F4

Closes the focused window

Move

None

Alt+F7

Move the focused window

Resize

None

Alt+F8

Resize the focused window

In addition, the shortcuts for Unicode character entry should also be avoided. This includes Shift+Ctrl+A through to Shift+Ctrl+F, or Shift+Ctrl+0 through to Shift+Ctrl+9.

Standard application shortcuts

This section details common application keyboard shortcuts. With the exception of application shortcuts, these shortcuts only need to be followed when the corresponding action is included in your application. Standard shortcuts can be assigned to other actions if the standard action is not available.

This section also provides guidance on standard menu items in a menu bar, should one be used.

Application

Standard application keyboard shortcuts and menu items. These application shortcuts should not be reassigned to other actions, even when the corresponding action is not provided by your application.

Label

Shortcut

Description

Help

F1

Opens the default help browser on the contents page for the application.

About

None

Opens the About dialog for the application. Use the standard GNOME 3 dialog for this.

Quit

Ctrl+Q

Closes the application, including all application windows.

File

Standard file keyboard shortcuts and menu items.

Label

Shortcut

Description

New

Ctrl+N

Creates a new content item, often (but not always) in a new primary window or tab. If your application can create a number of different types of document, you can make the New item a submenu, containing a menu item for each type. Label these items New document type, make the first entry in the submenu the most commonly used document type, and give it the Ctrl+N shortcut.

Open…

Ctrl+O

Opens an existing content item, often by presenting the user with a standard Open File dialog. If the chosen file is already open in the application, raise that window instead of opening a new one.

Open Recent

None

A submenu which contains a list of no more than six recently used files, ordered according to most recently used.

Save

Ctrl+S

Saves the current content item. If the document already has a filename associated with it, save the document immediately without any further interaction from the user. If there are any additional options involved in saving a file, prompt for these first time the document is saved, but subsequently use the same values each time until the user changes them. If the document has no current filename or is read-only, selecting this item should be the same as selecting Save As.

Save As…

Shift+Ctrl+S

Saves the content item with a new filename. Present the user with the standard Save As dialog, and save the file with the chosen file name.

Save a Copy…

None

Prompts the user to enter a filename, with which a copy of the document is then saved. Do not alter either the view or the filename of the original document. All subsequent changes are still made to the original document until the user specifies otherwise, for example by choosing the Save As command.

Like the Save As dialog, the Save a Copy dialog may present different ways to save the data. For example, an image may be saved in a native format or as a PNG.

Page Setup

None

Allows the user to control print-related settings. Present the user with a dialog allowing the user to set such options as portrait or landscape format, margins, and so on.

Print Preview

Shift+Ctrl+P

Shows the user what the printed document will look like. Present a new window containing an accurate representation of the appearance of the document as it would be printed.

Print…

Ctrl+P

Prints the current document. Present the user with a dialog allowing them to set options like the page range to be printed, the printer to be used, and so on. The dialog must contain a button labelled Print that starts printing and closes the dialog.

Send To…

Ctrl+M

Provides the user a means to attach or send the current document as an email or email attachment, depending on its format. You may provide more than one Send item depending on which options are available. If there are more than two such items, move them into a submenu. For example, if only Send by Email and Send by Bluetooth are available, leave them on the top-level menu. If there is a third option, such as Send by FTP, place all the options in a Send submenu.

Properties…

Alt+Return

Opens the document’s Properties window. This may contain editable information, such as the document author’s name, or read-only information, such as the number of words in the document, or a combination of both. The Alt+Return shortcut should not be provided where Return is most frequently used to insert a new line.

Close

Ctrl+W

Closes the current tab or window. If the window uses tabs and there is only one open, the shortcut should close the window.

Edit

Standard edit keyboard shortcuts and menu items.

Label

Shortcut

Description

Undo action

Ctrl+Z

Reverts the effect of the previous action.

Redo action

Shift+Ctrl+Z

Performs the next action in the undo history list, after the user has moved backwards through the list with the Undo command.

Cut

Ctrl+X

Removes the selected content and places it onto the clipboard. Visually, remove the content from the document in the same manner as Delete.

Copy

Ctrl+C

Copies the selected content onto the clipboard.

Paste

Ctrl+V

Inserts the contents of the clipboard into the content item. When editing text, if there is no current selection, use the caret as the insertion point. If there is a current selection, replace it with the clipboard contents.

Paste Special…

Shift+Ctrl+V

Inserts a non-default representation of the clipboard contents. Open a dialog presenting a list of the available formats from which the user can select. For example, if the clipboard contains a PNG file copied from a file manager, the image may be embedded in the document, or a link to the file inserted so that changes to the image on disk are always reflected in the document.

Duplicate

Ctrl+U

Creates a duplicate copy of the selected object.

Delete

Delete

Removes the selected content without placing it on the clipboard.

Select All

Ctrl+A

Selects all content in the current document.

Deselect All

Shift+Ctrl+A

Deselects all content in the current document. Only provide this item in situations when no other method of undoing selection is possible or apparent to the user. For example, in complex graphics applications where selection and deselection is not usually possible simply by using the cursor keys. Note: Do not provide Deselect All in text entry fields, as Shift+Ctrl+hex digit is used to enter Unicode characters so its shortcut will not work.

Find…

Ctrl+F

Displays a user interface for allowing the user to search for specific content in the current content item or page.

Find Next

Ctrl+G

Selects the next instance of the last Find term in the current document.

Find Previous

Shift+Ctrl+G

Selects the previous instance of the last Find term in the current document.

Replace…

Ctrl+H

Displays a user interface allowing the user to find specific content and replace each occurrence.

View

View keyboard shortcuts and menu items.

Label

Shortcut

Description

Icons

None

Shows content as a grid of icons. This is a radio button menu item.

List

None

Shows content as a list. This is a radio button menu item.

Sort By…

None

Specifies the criteria by which content should be sorted. Can open a preference dialog, popover, or sub-menu.

Filter…

None

Allows content to be filtered, by opening a popover, drop down, or dialog.

Zoom In

Ctrl++

Zooms in, making content appear larger.

Zoom Out

Ctrl+-

Zooms out, making content appear smaller.

Normal Size

Ctrl+0

Resets the zoom level back to the default value.

Best Fit

None

Makes the document fill the window.

Reload

Ctrl+R

Redraws the current view of the document, checking the data source for changes first. For example, checks the web server for updates to the page before redrawing it.

Format

Standard format keyboard shortcuts and menu items.

Label

Shortcut

Description

Style…

None

Sets the style attributes of the selected text or objects either individually or to a named, predefined style.

Font…

None

Sets the font properties of the selected text or objects.

Paragraph…

None

Sets the properties of the selected paragraph.

Bold

Ctrl+B

Toggles the boldness of the current text selection. If some of the selection is currently bold and some is not, this command should bolden the selected text.

Italic

Ctrl+I

Toggles the italicisation of the current text selection on or off. If some of the selection is currently italicized and some is not, this command should italicise the selected text.

Underline

Ctrl+U

Toggles underlining of the current text selection. If some of the selection is currently underlined and some is not, this command should underline the selected text.

Cells…

None

Sets the properties of the selected table cells.

List…

None

Sets the properties of the selected list, or turns the selected paragraphs into a list if they are not already formatted as such.

Layer…

None

Sets the properties of all or selected layers of a multi-layered document.

Page…

None

Sets the properties of all or selected pages of the document.

Bookmarks

Standard bookmark keyboard shortcuts and menu items.

Label

Shortcut

Description

Add Bookmark

Ctrl+D

Adds a bookmark for the current location. Do not pop up a dialog asking for a title or location for the bookmark, instead choose sensible defaults (such as the document’s title or filename as the bookmark name) and allow the user to change them later using the Edit Bookmarks feature.

Edit Bookmarks

Ctrl+B

Allows the user to edit their bookmarks.

Bookmark List

None

Displays the user’s bookmarks.

Go

Standard navigation keyboard shortcuts and Go menu items.

Label

Shortcut

Description

Back

Alt+Left

Navigates to the previous location.

Forward

Alt+Right

Navigates to the next location in the navigation history.

Up

Alt+Up

Navigates to the parent content item, document, page or section.

Home

Alt+Home

Navigates to a starting page defined by the user or the application.

Location…

Ctrl+L

Allows the user to specify a URI to navigate to.

Previous Page

PageUp

Navigates to the previous page in the document.

Next Page

PageDown

Navigates to the next page in the document.

Go to Page…

None

Allows the user to specify a page number to be navigated to. Text-based applications may also include a Go to Line… menu item, which allows the user to jump to a specified line number.

First Page

Ctrl+Home

Navigates to the first page in the document.

Last Page

Ctrl+End

Navigates to the last page in the document.

Windows

Standard Windows menu items.

Label

Shortcut

Description

Save All

None

Saves all open documents. If any documents have no current filename, prompt for a filename for each one in turn using the standard Save dialog.

Close All

None

Closes all open documents. If there are any unsaved changes in any documents, post a confirmation alert for each one in turn.

List of windows

None

Each menu item raises the corresponding window to the top of the window stack.