Understanding Key Rollover (NKRO vs. 6KRO), Matrix Ghosting, and Switch Chatter
Have you ever been playing an intense first-person shooter, sprinting diagonally (W + D + Shift), only to find that your Spacebar failed to trigger a jump? That frustrating hardware limitation is known as keyboard ghosting or key jamming.
In this technical guide, we break down the electrical architecture of keyboard switch matrices, why legacy office keyboards jam during multi-key gaming combos, how modern mechanical keyboards achieve true N-Key Rollover (NKRO), and how switch debounce algorithms impact overall input latency.
1. The Electrical Grid: How Keyboards Scan Keys
A standard full-size keyboard has 104 individual keys. If every single switch required its own dedicated wire trace back to the keyboard microcontroller, the PCB would require over 100 pins, drastically increasing manufacturing cost and complexity.
To solve this, keyboards organize switches into an electrical matrix composed of Rows and Columns (typically 16 to 18 columns and 6 to 8 rows):
- The microcontroller rapidly strobes electricity through Column 1, then Column 2, Column 3, etc.
- Simultaneously, it reads the input voltages across each Row line.
- When a key is pressed down, it closes the electrical contact between a specific Row and Column, pinpointing the key's matrix coordinates.
2. Ghosting & Jamming: Why Cheap Keyboards Block Keys
In a basic keyboard circuit lacking diodes, a problem arises when three keys forming a rectangle in the grid are pressed simultaneously:
Row 1: [Key A: PRESSED] ———— [Key B: PRESSED]
| |
Row 2: [Key C: PRESSED] ———— [Key D: OPEN/UNPRESSED]
Because electrical current can flow backward through closed mechanical switches, current from Row 1 flows through Key A, down to Key C, across to Key D's column, and tricks the microcontroller into believing Key D is also pressed! This false register is called a ghost key.
To prevent random unintended letters from spamming your screen, cheap membrane keyboards employ masking / jamming: if the controller detects an ambiguous state, it deliberately silences and ignores the third keypress.
3. NKRO vs. 6KRO: Diodes to the Rescue
How do mechanical gaming keyboards eliminate ghosting completely?
High-performance keyboards install a switching diode (such as a 1N4148 diode) at every individual switch junction on the printed circuit board. Diodes act as one-way electrical check valves: current can only travel in one direction, making reverse current back-feeding impossible.
6KRO (6-Key Rollover)
Standard USB Human Interface Device (HID) specification packet allows 6 alphanumeric keycodes plus 4 modifier keys (Ctrl, Shift, Alt, GUI) per report. Sufficient for most gaming, but can limit rhythm games (osu!, StepMania) or split-keyboard multiplayer.
NKRO (Full N-Key Rollover)
Modern gaming keyboards use custom USB report descriptors or multiple virtual HID endpoints to report every single key simultaneously. You can physically press your entire palm across 50 keys at once, and every key registers cleanly.
4. Switch Debounce, Optical Beams & Magnetic Hall Effect
Total keyboard latency is composed of three sequential pipeline stages:
- Mechanical Travel Time: The physical time taken for your finger to push the key down to its actuation point (typically 1.2mm to 2.0mm).
- Debounce Algorithm Time: Traditional mechanical switches (Cherry MX, Gateron, Kailh) physically bounce when metal leaves collide. The keyboard controller must wait 2ms to 8ms for the bounce noise to stabilize before dispatching the key.
- USB Scan & Polling Time: The matrix scanning cycle frequency (1,000Hz = 1.0ms).
The Hall Effect Revolution: Newer magnetic switches (Wooting, Razer Analog, SteelSeries OmniPoint) use Hall Effect sensors to detect permanent magnet proximity rather than physical metal contacts. Because there are no physical metal leaves to bounce, debounce latency is reduced to zero, and reset occurs instantly upon upward motion (Rapid Trigger).
5. Testing Your Keyboard with Browser DOM Events
How can you test if your keyboard suffers from ghosting or is limited to 6KRO?
Our Keyboard Tester visualizes your keyboard's key matrix in real time. It listens for browser keydown and keyup events using physical scan identifiers (e.code) rather than interpreted characters, allowing you to press 10+ keys simultaneously to verify whether your board delivers true NKRO.
❓Frequently Asked Questions
What is keyboard ghosting?▼
Keyboard ghosting occurs when a keyboard fails to register one or more keypresses because multiple keys are held simultaneously. It is caused by the keyboard matrix circuit design — when multiple keys share row and column lines, the controller cannot distinguish which physical key triggered the signal.
What is the difference between NKRO and 6KRO?▼
6KRO (6-Key Rollover) means a keyboard can register up to 6 simultaneous keypresses (excluding modifier keys). NKRO (N-Key Rollover) means every key on the keyboard can be pressed simultaneously and all will register independently. NKRO keyboards use diodes on each key switch to prevent ghosting.
Do mechanical keyboards have less input latency than membrane keyboards?▼
Mechanical keyboards typically have lower latency due to shorter actuation travel and faster switch response. However, the dominant source of keyboard latency is debounce time (2–8ms) and USB polling interval (1ms at 1000Hz). Hall Effect magnetic switches eliminate debounce latency entirely, making them the fastest currently available.
What is switch debounce and why does it matter?▼
When a mechanical key switch is pressed, the metal contacts physically bounce for a few milliseconds before making stable contact. Keyboard firmware uses a debounce algorithm (typically 2–8ms delay) to ignore these bounces and register only one keypress per physical press. Without debounce, a single press could register as multiple keystrokes.
How do I test if my keyboard has ghosting or rollover issues?▼
You can test keyboard ghosting and rollover using our free Keyboard Tester at spacebarclickeronline.com/keyboard-tester. It uses browser keydown and keyup events with physical scan codes (e.code) to detect simultaneous keypresses. Hold 10+ keys at once to verify whether your keyboard delivers true NKRO.
References & Further Reading
The circuit-level and firmware behavior described in this guide is grounded in the following technical references and specifications:
- How a keyboard matrix scans keys, and how ghosting and jamming arise — Dribin, D. Keyboard Matrix Help. dribin.org →
- The USB HID boot keyboard report: the origin of 6-key rollover (6KRO) — USB Implementers Forum. Device Class Definition for Human Interface Devices (HID), Version 1.11 — boot keyboard report descriptor (Appendix B). USB-IF (PDF) →
- 6KRO, NKRO and anti-ghosting terminology — Wikipedia. Key rollover. Wikipedia →
- Contact bounce and why controllers add a debounce delay — Ganssle, J. A Guide to Debouncing. ganssle.com →
Note: Rollover limits, debounce windows, and actuation points vary by keyboard model, switch type, and firmware; the millisecond ranges cited here are representative, not measurements of any specific board. Verify your own keyboard's rollover and switch chatter with our Keyboard Tester.
Test Your Keyboard Rollover & Switch Chatter
Test key matrix rollover, detect ghosting, count simultaneous presses, and verify switch debounce health in our interactive tester.