Key rollover and ghosting, explained

Why some keyboards drop inputs when you hold three keys at once, what NKRO actually guarantees, and how to test your own board in seconds.

Cover image for Key rollover and ghosting, explained

Hold down three or four keys at once on an inexpensive keyboard and something odd happens: one of them stops registering, or a key you never touched appears. Neither is a fault in the usual sense. Both come from how the keyboard is wired.

The matrix

A keyboard does not run one wire per key — that would need 104 connections to the controller on a full-size board. Instead the switches sit at the intersections of a grid, typically around 8 rows by 18 columns, and the controller scans that grid rapidly, energising one row at a time and reading which columns respond.

This is cheap and compact. It also creates an ambiguity.

Where ghosting comes from

Press three keys that form three corners of a rectangle in the matrix, and current can travel an unintended path through the closed switches, making the fourth corner look closed too. The controller reports a key nobody pressed. That phantom is the ghost.

Manufacturers avoid shipping ghosts by adding blocking: when the controller detects an ambiguous pattern it discards the input rather than guess. So on most membrane keyboards you do not get phantom keys — you get missing ones. The third key simply never arrives.

Diodes and NKRO

The fix is a diode at every switch, forcing current one way and removing the ambiguity entirely. A board wired this way can report every key simultaneously and is sold as NKRO, or N-key rollover.

Two caveats are worth knowing:

  • 6KRO over USB is a protocol choice, not a hardware limit. The standard USB HID keyboard descriptor carries six keys plus modifiers. Many NKRO boards default to that for firmware compatibility and need a switch or key combination to enable full NKRO.
  • Modifiers are counted separately. Ctrl, Shift, Alt and the Windows or Command key travel in their own byte, so “6KRO” really means six non-modifier keys.

Testing your own board

Open a key tester and hold combinations while watching what lights up:

  1. Press and hold three ordinary letter keys — say Q, W and E. Most boards manage this.
  2. Try clusters that share matrix rows, such as W, A, S and D together with Space. This is where gaming-oriented boards are usually reinforced.
  3. Add keys until something stops registering. The number you reach is your practical rollover limit.

If you are diagnosing a suspected fault rather than measuring rollover, press keys one at a time. Rollover limits only appear when several keys are held together, so a one-at-a-time pass cleanly separates a dead switch from a matrix limitation.

Back to all posts