Inside the Keyboard
The processor in a keyboard has to understand several things that are important to the utility of the keyboard, such as:
  • Position of the key in the key matrix.
  • The amount of bounce and how to filter it.
  • The speed at which to transmit the typematics.


The microprocessor and controller circuitry of a keyboard.

The key matrix is the grid of circuits underneath the keys. In all keyboards except for capacitive ones, each circuit is broken at the point below a specific key. Pressing the key bridges the gap in the circuit, allowing a tiny amount of current to flow through. The processor monitors the key matrix for signs of continuity at any point on the grid. When it finds a circuit that is closed, it compares the location of that circuit on the key matrix to the character map in its ROM. The character map is basically a comparison chart for the processor that tells it what the key at x,y coordinates in the key matrix represents. If more than one key is pressed at the same time, the processor checks to see if that combination of keys has a designation in the character map. For example, pressing the a key by itself would result in a small letter "a" being sent to the computer. If you press and hold down the Shift key while pressing the a key, the processor compares that combination with the character map and produces a capital letter "A."


A look at the key matrix.

The character map in the keyboard can be superseded by a different character map provided by the computer. This is done quite often in languages whose characters do not have English equivalents. Also, there are utilities for changing the character map from the traditional QWERTY to DVORAK or another custom version.

Keyboards rely on switches that cause a change in the current flowing through the circuits in the keyboard. When the key presses the keyswitch against the circuit, there is usually a small amount of vibration between the surfaces, known as bounce. The processor in a keyboard recognizes that this very rapid switching on and off is not caused by you pressing the key repeatedly. Therefore, it filters all of the tiny fluctuations out of the signal and treats it as a single keypress.

If you continue to hold down a key, the processor determines that you wish to send that character repeatedly to the computer. This is known as typematics. In this process, the delay between each instance of a character can normally be set in software, typically ranging from 30 characters per second (cps) to as few as two cps.