Keyboard interaction covers a range of behaviors, from text entry and shortcuts, through to the keyboard being used as the sole input device. The latter is vital for visually-impaired people or those with mobility impairments.
While many aspects of keyboard interaction are relevant to accessibility, some users prefer to use the keyboard and it can be an efficient alternative to pointer-based interaction.
Just as it should be possible to perform every action with a pointing device, so every action should also be possible with the keyboard. Most of the time, this is easy to acheive with the standard keyboard features described below. However, some operations — like drag-and-drop — may require more thought.
Test how accessible your app is by trying to use it with just a keyboard.
Use the standard GNOME shortcut keys if your application supports those functions. This ensures consistency between GNOME applications and aids discoverability.
Shortcut keys should also be assigned to the most commonly-used actions in your application. However, don’t assign shortcuts for everything.
When assigning non-standard shortcuts in your application:
Try to use Ctrl in combination with a letter.
Shift+Ctrl and a letter is the recommended pattern for shortcuts that reverse or extend another function. For example, Ctrl+Z is the shortcut for undo, and Shift+Ctrl+Z is the shortcut for redo.
Shortcuts should be as mnemonic as possible, as this makes them easier to learn and remember. For example, Ctrl+E would be a good shortcut for an edit action.
Do not use Alt for shortcut keys, as this may conflict with access keys.
GNOME reserves the use of the Super key for use in system shortcuts. Super should therefore not be used by applications. Additional legacy system shortcuts should also be avoided by apps.
Don’t assign awkward reaches. Some people may only be able to use one hand on the keyboard, so shortcuts that can be easily used with one hand are preferable for common operations. (This guideline also applies to access keys below.)
The technical term for shortcut keys is accelerators.
Access keys allow someone to operate labelled controls by holding Alt in combination with another key. These are indicated by an underlined letter within each control label (this is displayed when Alt is held down). As far as possible, all labelled components should have an access key.
Guidelines for selecting access keys:
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 it is difficult to assign access keys to all labelled controls, 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.
The technical term for access keys is mnemonics.