Keyboard ghosting and rollover explained
When you hold several keys at once, a keyboard can drop one of them, refuse the whole combination or report a key you never touched. Rollover is the number of keys a keyboard can report together, and ghosting is the name for the key that appears out of nowhere. This guide follows a key press from the switch to the browser: how the keyboard reads its keys, where ghosts come from, why some keyboards block combinations instead, and what the 6-key limit and n-key rollover mean in practice. It ends with a way to test your own keyboard on the Keyboard tester.
What a keyboard sends to the computer
A USB keyboard does not send a message each time a key goes down or comes up. It sends reports, and each report lists the keys that are down at that moment. The HID specification, the USB standard for keyboards and mice, says reports must contain a list of keys currently pressed, not separate press and release codes (USB-IF, 2001). The computer works out what changed by comparing each report with the one before.
Two details follow from that design. First, when two keys appear in the same report, their order cannot be known. The specification says so directly, and a keyboard is allowed to gather several changes into a single report. Second, key repeat is the computer’s job. The specification places the repeat rate and the delay before the first repeat in the host, not the keyboard, and recommends 500 ms as a keyboard’s default idle rate, which it ties to the delay before the first repeat.
In the browser, each change becomes an event. The W3C UI Events draft says a browser must fire keydown when a key is pressed and keyup when it is released, and marks a held key’s repeated keydown events as repeats (W3C, 2026). The Keyboard tester ignores those repeats, so holding a key counts it once.
How a key matrix makes ghost keys
The QMK firmware documentation explains that without a matrix circuit, every switch would need its own wire to the controller (QMK, n.d.). In a matrix, the switches sit in rows and columns instead. The controller sends a signal to one column at a time and reads all the rows at once. A row that picks up the signal has a closed switch where it crosses that column.
Ghosts appear when three held keys sit at three corners of a rectangle in the grid. Say you hold three keys: A at column 1, row 1, B at column 1, row 2 and C at column 2, row 1. When the controller powers column 2, the signal goes through C into row 1, through A into column 1 and through B into row 2. Row 2 now reads as active under column 2, and the controller sees a fourth key that nobody pressed. QMK describes this ghosting with a 2×2 grid of four keys and notes that it is rare but can be much more common on a bigger keyboard.
The fix is a diode next to each switch. A diode lets current flow only one way, so the signal cannot take the backward path through the other keys, and the controller reads exactly the three keys that are down.
Blocking instead of ghosting
A keyboard built without a diode on every switch cannot tell a real fourth key from a ghost, so it can refuse to report the combination instead. The HID specification provides for this. A keyboard may report what it calls a phantom state when a combination of keys cannot be read reliably, and a boot keyboard must do so for ghost key and rollover errors (USB-IF, 2001). In the phantom state, every key slot carries an error code instead of a key.
To the person typing, a blocked key simply does nothing. You hold two keys, press a third and nothing appears. Let go of one of the first two and the third may arrive. In the specification’s own example, the modifier keys, such as Shift and Ctrl, are still reported during the phantom state, because they travel in a separate byte of the report.
A ghost and a block show up differently in the Keyboard tester. A ghost lights a key you are not touching. A block leaves a key you are holding dark, and Most keys held at once stops rising.
Rollover: 6-key and n-key
The HID specification defines a simple boot format that a computer’s firmware can read before the operating system starts. It has room for six keys plus the modifiers, and with more than six keys down the keyboard must report the error state. This limit is what 6-key rollover, or 6KRO, refers to.
The boot format exists so a keyboard works before any driver has loaded. When the operating system’s driver loads, it switches the keyboard to the report format the keyboard describes for itself, and that format can be longer. N-key rollover, or NKRO, means a keyboard can report every key that is down, however many there are.
QMK, a keyboard firmware, shows the tradeoff. NKRO is a build option, and the documentation notes that in some situations, in particular the BIOS setup screen, the keyboard needs to fall back to 6KRO. It offers a key combination, both Shift keys plus N by default, to switch between the two modes temporarily (QMK, n.d.).
Whether six keys are enough depends on how many you hold at once. In a game you may hold two movement keys and a run key while pressing another key for an action, which is easy to check in the tester.
Testing your own keyboard
Press Start testing, then press and hold keys one at a time while you watch the board and the Most keys held at once count. Use the keys you actually combine, such as W, A, Shift and Space for a game or Ctrl, Shift and a letter for a shortcut. If every key lights up and the count keeps rising, the keyboard reports that combination.
Then try combinations that share rows and columns. Keyboards differ in how their matrix is laid out, so there is no single combination that finds every ghost. Clusters of neighboring letters, such as Q, W, A and S, are a reasonable start. A key that lights without being pressed is a ghost, and one that stays dark while held is a block.
The count includes modifiers. The boot format fits six keys plus the modifiers, so a reading of 7 or 8 with Shift and Ctrl held does not prove n-key rollover. To check for NKRO, hold seven or more keys that are not modifiers.
If you switch to another window while holding keys, the browser stops sending key events to the page, so the tester counts held keys as tested and clears them. Hold your combinations with the tester window in front.
Other tests to try
With the keyboard checked, the six other BlinkGauge tests are linked below, from reaction time and click speed to memory and color.
Sources
- QMK (n.d.). How a keyboard matrix works. QMK Firmware documentation. docs.qmk.fm/how_a_matrix_works
- QMK (n.d.). Miscellaneous FAQ: NKRO doesn’t work. QMK Firmware documentation. docs.qmk.fm/faq_misc
- USB Implementers Forum (2001, June 27). Device Class Definition for Human Interface Devices (HID), Firmware Specification, version 1.11. usb.org/sites/default/files/hid1_11.pdf
- W3C (2026, February 21). UI Events, Working Draft. w3.org/TR/uievents