Keyboard Ghosting Explained!
What is the problem?
“Ghosting” is the problem that some keyboard keys don’t work when multiple keys are pressed simultaneously. The key presses that don’t show up on the computer or seem to have disappeared are said to have been “ghosted”. On most keyboards, even some that are explicitly marketed as “Anti-Ghosting,” this happens with many three key combinations. Imagine playing your favorite video game and not being able to, say, run diagonally and fire your weapon at the same time (say pressing a, w, and g simultaneously). This is a result of the internal design of most existing keyboards, as will be explained below.
But my keyboard says it is “Anti-Ghosting!”
When a keyboard is marketed as “Anti-Ghosting” it may just refer to a particular subset of keys on the keyboard working well together. This does not necessarily guarantee that members of this set of keys avoid ghosting when combined with other keys on the keyboard.
Another marketing strategy is to state that the keyboard allows “up to” some large number of key presses. This would be a true statement about a keyboard even if only a single combination of keys of that size can be pressed simultaneously while many three key combinations remain with ghosting issues. A user of a keyboard like this might attribute the remaining errors to other sources. For instance, a user playing a game might think that he or she had not hit the key fast enough for the rules of the game, rather than the key not being reported by the hardware at all.
Unlike partial anti-ghosting solutions which have many combinations of 3 keys which do not work, Microsoft’s SideWinder X4 features multitouch technology that allows it to detect and report ANY combination of 17 or fewer QWERTY keys. Additionally, it can report 7 modifier keys, 1 hot key and 1 macro key, bringing the maximum number of reported keys to 26. See the SideWinder X4 Anti-Ghosting FAQ for more information.
What causes ghosting?
Typically, ghosting is the result of one or more of following three limitations: the hardware can’t read the given key combination, the software on the computer doesn’t support multiple simultaneous keys, or the communication protocol between the hardware and software limits the maximum number of simultaneous keys reported. The next section discusses in more detail the hardware design of typical keyboards that limits the number of keys that can be read at the same time.
Why wouldn’t keyboard hardware be able to read some keys?
Most keyboards are made of a stack of plastic sheets printed with silver ink in a grid of column and row wires, initially unconnected, underneath the keys. A key press can then be detected as a connection made between a particular pair of column and row wires from the pressure of the key above it.
Typically, when the keyboard looks to see what key is pressed, it looks at each column wire, one at a time, and sees which row wires are connected, or shorted, to it. When only one key is pressed, there will be exactly one column wire which when examined will have any row wires shorted, and then, exactly one row wire. This pattern uniquely identifies which key was pressed; there is only one contact point that could cause these test results.
When two keys are pressed simultaneously, again, the keyboard will look at each column wire to see which row wires are connected to it. When the rows and columns are both different between the two keys, there will be two column wires that each produce one row wire short, and those row wires will not be the same. This can only happen with one set of key presses, so the keyboard can report exactly which keys are down.
When the two key presses share a column, the key presses can again be determined with certainty. A test pass for shorts will show only one column wire being connected to any row wires, and that wire will be connected to exactly two rows. Similarly, when the two keys share a row, the pattern will be that each of two column will show a single row connection, and both will be the same row. This, too, can only happen for one set of depressed keys for a given pattern of shorts. In fact, any set of collinear contacts can be uniquely determined.
Collinear Simultaneous Key Patterns Are Distinct
However, when three keys are pressed, it is not necessarily true that the keys producing the pattern of shorts can be uniquely determined. For instance, when the three keys share both a row and a column, there are five different sets of keys that each would produce the same pattern of shorts: the same two columns each connected to the same two rows. (Notice that in the above example, the connected column on the right is shorted to the upper of the two connected rows by way of all three contacts; in fact, the circuit includes a div class=”asContentParagraph” of the connected column wire on the left). The five different sets of key presses that produce the same pattern of shorts as illustrated above are illustrated below.
Indistinguishable Key Presses
Remember, the typical keyboard just checks if a column is connected to a row. The number of contacts it must travel through don’t add up, becoming “more connected” as more connections are added. The keyboard just sees the presence or absence of a connection, making the above patterns indistinguishable. When this happens, that the pattern is ambiguous, the typical keyboard stops reporting new key presses to avoid reporting the wrong keys. We call these unreported key presses, “ghosted.”
Not all sets of simultaneous keys larger than two are ambiguous (for instance, the example given earlier of collinear keys). Usually, keyboards will report as many unambiguous keys as they can. However, the standard reporting protocol limits the number of simultaneous keys to six QWERTY keys plus the modifiers (such as shift, control, and alt). Some anti-ghosting keyboards are able to report additional keys beyond this either by using a custom reporting protocol designed with an increased limit or by sending additional reports for combinations of large numbers of keys. However, both of these solutions pose problems. The use of a custom protocol may not function properly prior to loading the operating system, such as when the computer is booting or when an operating system is being installed. A keyboard like this may require switching between protocols to support states when the custom protocol can’t be used. In contrast, sending multiple reports allows the keyboard to remain usable when the computer is in these states. However, because, the computer’s keyboard software was not designed to be used in this manner, there is a potential for unexpected behavior by the software receiving the multiple reports instead of a single report when large numbers of simultaneous keys are pressed.
How do keyboard designers improve on this?
An easy change that keyboard makers utilize is to rearrange the wires such that important key combinations don’t exhibit this problem. However, all this does is move the problems to other sets of keys, where the user is less likely to notice.
Another possibility is to add extra wires to create more unambiguous cases. However, this is more expensive as more circuitry is needed to read the extra wires.
At the extreme, keyboards have been made with a diode at every key so that each key can be detected individually. As we discussed above, when only pressing three keys in certain configurations, a fourth key would appear to also be pressed because a circuit would be completed ‘traveling backwards’ along the normal routes established by each of the three contacts. Diodes prevent this kind of a circuit from forming because diodes conduct current in only one direction. However, because this requires printing a circuit board with over a hundred diodes, it is relatively expensive.
In contrast, Microsoft’s advanced anti-ghosting technology leverages multi-touch technology to prevent key ghosting. In addition, by using standard manufacturing techniques and avoiding diodes and large printed circuit boards, this technology remains inexpensive to produce, making it an interesting alternative to other currently available options.