Problem

Text and numeric entry must be simple, easy, and should be so predictable in behavior it may be performed with little or no instruction.

Solution

The typewriter or computer keyboard, and the telephone keypad, have become so ubiquitous that they are, to most populations, the expected method of entering information, even when simulated by membrane pals or on a screen.

will stay that w? for the foreseeable future....

good input all about meeting expectations... see notes about kb layout, NANP, localization...

Variations

Instead of variations, Keyboards and Keypads can be most easily considered to have three axes of variation. Any one implementation combines the attributes from each axis to define the category. Most devices will use multiple modes, which are switched between as the state of the device changes. For more discussion on mode switching see the Input Method Indicator pattern. For additional details on keypad entry for telephony, see the Dialer pattern.

Hardware / Virtual -

Keyboard / Keypad -

Direct / Multi-tap -

While these descriptions, and the remainder of this pattern, focus on the standard implementation, each axis is actually more of a continuum. A single implementation may fall in the middle, such as some non-standard keyboard/keypad combination layouts. This simply means that the same principles apply to even those implementations.

Predictive systems, while associated with 10-key entry, are actually just methods that can be applied to any input method. These are addressed in detail the Autocomplete & Prediction pattern.

Interaction Details

Hardware keys should comply with Human Factors standards for pressure, size and spacing. Virtual entry systems should have targets no smaller than 10 mm. Certain keys, especially enter, space and modifiers, may be placed along the edges of the viewport on flat bezel devices, to increase their effective size. High use keys, such as the spacebar, should be larger to make them easier to find and activation. Keys which can have consequences past a single entry, such as enter and modifiers, should have spacing around them to prevent accidental activation.

The layout and key arrangement should, whenever possible, use common and expected formats. For keypads, use regional standards promulgated by the local telecommunications authorities. In North America, for example, this does not just mean the layout is 1 at the top left, but that the 2 key has the letters "ABC" assigned to it.

Keyboards may have to be compressed, and combine the number row with the top row of letters. Make sure the numbers align to their normal location, so Q will also be 1 when a function modifier is used. Likewise, place all conventional symbols as close as possible to their typical location. The !@#$ symbols should be alternatives of the 1234 keys -- or the closest equivalent when compressed -- for US English keyboards.

For keyboards, provide an enter function as part of the return key; users may submit entries without leaving the keypad or keypad area.

key repeat

special keys, like Sym, dotcom...

Unless hardware directional keys (which see) are included on a device, hardware keyboards should be accompanied by one...Hardware keypads are always, and usually also have Soft keys (link)

Switching language on virtual keyboards...

Presentation Details

Key labels must be clear, large enough for users to read, and easy to read in all lighting conditions. Alternative labels (shift or Fn characters) should be in a different (less prominent) color, or a tint of the primary label color. Alternative labels should be above the primary label. There is no need to display capital letters as alternative labels to lower case letters.

On virtual keyboards, use the label for the current state, to assure the state is clear. Display lower-case labels unless the caps or caps-lock key is activated.

Further behavior of the Shift & Function state changing keys are a special case, discussed separately.

Labels must match in both reflective (ambient light) and transmissive (illuminated backlight) mode. If the "Fn" key is entirely yellow, to match the yellow function key mode labels on the rest of the keyboard, then when illuminated this key must be entirely yellow and the labels on the individual keys must also be yellow.

Keys must perform their labeled behavior. Note, for example, that backspace and delete are different things. Users accustomed to Windows will think "del" means "forward delete" and not backspace as it is labeled on the Macintosh and some other devices.

...some discussion of the tradeoffs in symbols for internationalization and some of these issues (del vs. backspace) and ambiguity in labels. Even the common down then left arrow is not recognized universally as a return or enter key to many users.

Antipatterns

Avoid accidental input. Lock keypads when sensors determine they are in pockets, against the user's face (on a call), etc. In any context, if multiple adjacent keys are pressed within a few milliseconds, this can be assumed to be incorrect and only the most likely key -- by physical mapping or Autocomplete & Prediction -- should be accepted, or none. Staggered keyboard layouts can also help prevent accidental inputs or increase the accuracy of filtering.

Use caution with backlight in marginal lighting. It is easy to have the backlight illumination match the key material reflectivity, and the label cannot be seen at all. Besides careful coordination of the backlight algorithm, using a color different from the key material for the label (e.g. yellow, instead of white light, on black keys) can alleviate this issue.

Don't use weird layouts.... unless you test it, and then have a good way to market...

Examples