Introduction to keyboards
Tips for software developers
- Do not assume there is a one-to-one relationship between keystrokes and characters. Java, Windows, and X all allow the program to see keyboard events as well as typed characters. You cannot assume that a key down will produce a character, or that you will see a key down before a character is entered. In the case of IMEs, it is possible for multiple characters to be entered at once.
- Do not assume that there are two Alt keys, or that the layout has an AltGr.
- Do not assume anything about the assignment of characters on a keyboard. For instance, do not assume that numbers are unshifted or that A and S are adjacent (see Figure 2).
- Do not assume that the Forward Tab key on a North American keyboard will behave in the same way on a keyboard for countries in the Middle East.
- When defining a key as a combining/nonescaping key or a repeating key, do not assign a key to be both repeating and combining at the same time.
- Be careful not to assign meaning to pressing keys which form part of a dead key, IME, or escape sequence. For instance, on PC's you should be able to press the Alt and a set of digits from the numeric keypad to enter a numeric character code. In this case you should disregard the press and release of the Alt.
- Allow the entry of all the graphic characters in the active coded character set by providing alternative methods of entering characters based on code point (such as the Alt-Numpad or ALT+0nnn input method on Windows platforms). For example, to enter the Yen sign on Windows platforms, you would hold the left Alt key down, type the decimal digits 0165 using the numeric keypad and then release Alt.
- Test your program with a variety of keyboards. In particular, test with keyboard layouts which use AltGr, dead keys, and a national group.
- When doing globalization testing, use the keyboard layouts of the language you are testing. This makes it easier to enter characters outside of the basic Latin set.
Need assistance with your globalization questions?