Overclock.net - An Overclocking Community - View Single Post - [Official] Mechanical Keyboard Guide

View Single Post
post #9 of (permalink) Old 04-15-2009, 02:48 PM - Thread Starter
Retired Staff
Join Date: Mar 2008
Posts: 11,951
Rep: 726 (Unique: 481)

Miscellaneous Resources

Keyboard Customization Guides
Dye Your Old White/Grey Keyboard

Switch Technologies
Qwerter's Clinic Cherry MX Info
NKRO on Microsoft Sidewinder x4 - Resistance method
All About Scissor Switches

SharpKeys - Basic Keyboard Programming
Autohotkey - Advanced Keyboard Programming

Interfaces and Protocols
Interfacing the AT and PS/2 Keyboards
PS/2 Keyboard Interface
PS/2 Keyboard Protocol
XT Scancodes
AT, PS/2, and USB Scancodes
USB in a Nutshell

Switch Matrix and Actuation Design


Diagrams and explanation (Click to show)

Keyboards use a matrix of wires, in rows and columns. Each key is a switch that connects a row to a column, where each key has it's own unique position, or address, in the matrix.

This is a very simple 4-key matrix. You won't ever see something this simple in a keyboard, but for our purposes it's more than enough.

To detect keypresses, the keyboard will scan column by column and check to see which rows have been activated. In the image below, when the keyboard activates C1, R1 goes hot and therefore it knows that A has been pressed. When it activates C2, neither R1 nor R2 go hot so it knows that B and D haven't been pressed.

Multiple key presses work in the same way. In this image you can see that when C1 is activated, R1 goes hot, giving the letter A. Then when C2 is activated, R2 goes hot, giving the letter D.

But the problem in this matrix shows up as soon as you press three keys at once. In this image A, B, and D are pressed. The B and D switches short R1 with R2 because they are both closed; so when C1 is activated, both R1 and R2 go hot and the keyboard thinks that C has been pressed, and sends it to the PC even though you didn't really press it. This is what's called a "ghost" key.

There are two methods used to prevent ghosting. The first and cheaper option is for the controller to block that third keypress that causes the ghost key. So after pressing A and D, it ignores both B and C because pressing either one will cause the other to ghost. This gives this board 2-key rollover, because only 2 keys can be pressed at once.

The other option is to install a switching diode in series with each switch. The diodes only allow the current to flow in one direction, so the rows no longer get shorted to each other. In the image below you'll see the A, B, and D keys pressed again, but this time there are diodes to control the flow. Notice how R2 no longer goes hot when C1 is activated.

This method allows for each and every key on the board to be detected independently, giving it n-key rollover (NKRO). It's called n-key because n is a variable, representing the number of keys on the keyboard.

Manyak is offline