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 http://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:

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):

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:

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:

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.