Fundamentals of Designing User Interaction - Input Basics

Keyboard Input

The keyboard is used primarily for entering and editing textual information. However, the Windows interface also supports the use of the keyboard to navigate, toggle modes, modify input, and, as a shortcut, invoke certain operations. The fact that users can navigate through the interface by using the keyboard as well as by using the mouse is a fundamental principle and one of the key advantages of the Windows user interface.

Cross referenceMore Information

For more information about using the keyboard for navigation, selection, and editing, see Chapter 6, "General Interaction Techniques." Additional information is also available on the Microsoft Accessibility Web site at https://microsoft.com/enable/products/keyboard.htm.

Below are the common interactive behaviors performed by using the keyboard.

Common Keyboard Actions
Action Description
Pressing Pressing and releasing a key. Unlike mouse interaction, keyboard interaction occurs on the downstroke of the key. Pressing typically describes the keyboard interaction for invoking particular commands or for navigation.
Holding Pressing and holding down a key. Holding typically describes interaction with keys such as ALT, SHIFT, and CTRL that modify the standard behavior of other input such as another key press or mouse action.
Typing Typing in text with the keyboard.

Text Keys

Text keys include the following:

  • Alphanumeric keys (a_z, A_Z, 0_9)
  • Punctuation and symbol keys
  • TAB and ENTER keys
  • The SPACEBAR

NoteNote

Most keyboards include two keys labeled ENTER, one on the main keyboard and one on the numeric keypad. Because these keys have the same label, assign both keys the same functionality. (Note that on some keyboards, the latter may not be available.)

In text entry, pressing a text key enters the corresponding character and typically displays that character on the screen. Except in special views, the characters produced by the TAB and ENTER keys are not usually visible. In some contexts, text keys can also be used for navigation or for invoking specific operations.

Access Keys

An access key is an alphanumeric key — sometimes referred to as a mnemonic — that, when used in combination with the ALT key, navigates to and activates a control. The access key matches one of the characters in the text label of the control. For example, pressing ALT+O activates a control whose label is "Open" and whose assigned access key is "O". Typically, access keys are not case sensitive. The effect of activating a control depends on the type of control.

In Windows 2000, access keys are hidden by default to simplify the user interface. However, the operating system displays the access keys whenever the user initiates a keyboard command — for example, by pressing the ALT key.

Use the following guidelines to assign access key characters to controls in your application (in order of preference):

  • The first letter of the label for the control, unless another letter provides a better mnemonic association
  • A distinctive consonant in the label
  • A vowel in the label

Avoid assigning a character where the visual indication of the access key cannot be distinguished from the character. For example, access keys may not be visible if you format a menu item using underlined text. Also, avoid using a character usually assigned to a common function. For example, when you include an Apply button, reserve the "A" — or its localized equivalent — as the access key for that button. In addition, do not assign access keys to the OK and Cancel commands when they map to the ENTER and ESC keys, respectively.

Define an access key to be unique within the scope of its interaction — that is, the area where the control exists and where keyboard input is currently being directed. If duplicate access keys are assigned within the same scope, the first control is activated when the access key is pressed. Depending on the control, pressing the access key a second time may or may not activate another control with the same assignment.

Cross referenceMore Information

For more information about static text controls, see Chapter 8, "Menus, Controls, and Toolbars."

Controls without explicit labels can use static text controls to create labels with assigned access keys. Software that supports a writing system other than roman, such as Kanji, and that runs on a standard keyboard, can prefix each control label with a roman alphabetic character as its access key.

Mode Keys

Mode keys change the actions of other keys (or other input devices). There are two kinds of mode keys:

  • Toggle keys — A toggle key turns a particular mode on or off each time it is pressed. For example, pressing the CAPS LOCK key toggles between uppercase and lowercase alphabetic keys; pressing the NUM LOCK key toggles between numeric and directional input using the keypad keys.
  • Modifier keys — Like toggle keys, modifier keys change the actions of normal input. Unlike toggle keys, however, modifier keys establish modes that remain in effect only while the modifier key is held down. Modifier keys include the SHIFT, CTRL, and ALT keys. Such a "spring-loaded" mode is often preferable to a "locked" mode because the key must be activated continuously by the user. This makes using the modifier key a conscious choice and allows the user to cancel the mode easily by releasing the key.

Users who cannot hold down two keys at one time can use the StickyKeys accessibility feature that enables them to simulate key combinations by pressing keys sequentially. This function is supported only for the SHIFT, CTRL, and ALT keys, so your application should not require multiple-key combinations that do not include one of these three keys.

Because it can be difficult for a user to remember multiple modifier assignments, avoid using multiple modifier keys as the primary way to access basic operations.

In some contexts, the keyboard may not be available. Therefore, use modifier-based actions only to provide quick access to operations that are supported adequately elsewhere in the interface.

Shortcut Keys

Shortcut keys (also referred to as accelerator keys) are keys or key combinations that users can press for quick access to actions they perform frequently. CTRL+letter combinations and function keys (F1 through F12) are usually the best choices for shortcut keys. By definition, a shortcut key is the keyboard equivalent of functionality that is supported adequately elsewhere in the interface. Therefore, avoid using a shortcut key as the only way to access a particular operation.

Cross referenceMore Information

In international versions of your software, there may be no mnemonic relationship between a command and its shortcut key. In this case, it may be more useful to use function keys instead, even though they are harder for most users to remember. For a list of the most common shortcut key assignments, see Appendix B, "Keyboard Interface Summary."

When you define shortcut keys, keep the following guidelines in mind:

  • Assign single keys whenever possible. These are the easiest actions for the user to perform.
  • Do not make modified letter+key combinations case sensitive.
  • Use SHIFT+key combinations for actions that extend or complement the actions of the key or key combination used without the SHIFT key. For example, pressing ALT+TAB switches windows in a top-to-bottom order. Pressing SHIFT+ALT+TAB switches windows in reverse order. However, avoid using SHIFT+text key combinations, because the effect of the SHIFT key may differ for some international keyboards.
  • Use CTRL+key combinations for actions that represent a larger scale effect. For example, in text editing contexts, pressing HOME moves the cursor to the beginning of a line, and pressing CTRL+HOME moves the cursor to the beginning of the text. Use CTRL+key combinations for access to commands where a letter key is used — for example, use CTRL+B for bold. Remember that such assignments may be meaningful only for English-speaking users.
  • Avoid ALT+key combinations because they may conflict with the standard keyboard access for menus and controls. The ALT+key combinations — ALT+TAB, ALT+ESC, and ALT+SPACEBAR — are reserved for system use. ALT+number combinations enter special characters.
  • Avoid assigning the shortcut keys defined in this guide to other operations in your software. That is, if CTRL+C is the shortcut for the Copy command and your application supports the standard copy operation, don't assign CTRL+C to another operation.
  • Whenever possible, enable the user to change the shortcut key assignments in your application.
  • Use the ESC key to stop a function in process or to cancel a direct manipulation operation. It is also usually interpreted as the shortcut key for a Cancel button.

Some keyboards also support three new keys: the Application key and the two Windows keys. The primary use for the Application key is to display the shortcut menu for the current selection (the same as pressing SHIFT+F10). You may also use it with modifier keys for application-specific functions. Pressing either of the Windows keys — left or right — displays the Start menu. These keys are also used by the system as modifiers for system-specific functions. Do not use these keys as modifiers for non-system-level functions.

Fundamentals of Designing User Interaction

Windows Interface Components

Design Specifications and Guidelines

Appendixes and References