announcement

Share the latest technology trends or photos of gadgets you love.

How Does a Computer Keyboard Work?

Few of us would bother to know the technical know-how involved in understanding how a computer keyboard works, but the fact is, its working will fascinate you, and it is briefly explained in this Techspirited article.
Ningthoujam Sandhyarani
Last Updated: Apr 12, 2018
Did You Know?
The current keyboard layout, or the QWERTY layout, which is based on the layout of the typewriter, was designed not to increase the speed of typing, but to slow it down in order to avoid typewriters from jamming.
A computer keyboard is a hardware device that functions in accordance with the instructions provided by the user. It comprises circuits, switches, and processors that help in transferring keystroke messages to the computer. In today's technology-driven world, everyone is aware about computing, and how to use a PC. We all know that the keyboard is an input device that functions in accordance to the instructions of the user. It is used for performing various tasks, such as typing on a word processor or text editor, accessing menus, and playing games. In this article, we take a closer look at how computer keyboards work.
Types of Keyboards
This device has not undergone too much of a transformation ever since it was introduced. Additional keys have been added, and of course, and it is available in a customized version in every electronic appliance with practically the same format (save a few keys here and there), like the laptop, iPad, smartphones, etc. However, some of the most common keyboards are:
  • 82-key Apple standard keyboard
  • 108-key Apple Extended keyboard
  • 101-key Enhanced keyboard
  • 104-key Windows keyboard
Types of Keys
The device we use at present was modeled in the 1940s based on the technology of a typewriter keyboard. In general, most of the keyboards contain 80 to 110 keys, depending on the OS, the manufacturer, or the application it is made for. There are four basic types of keys:
  • Function keys
  • Typing keys
  • Numerical keys
  • Control keys
This can be better understood with the help of the diagram below.
Types of Keys
In the picture, the top row (F1-F12) consists of the function keys. They are assigned certain commands by the operating system. For instance, in Windows XP, in the Microsoft Powerpoint application, the F5 key is a shortcut to start a 'Slideshow', while in Microsoft Word, the F11 key is used for formatting data.

The second row contains numerical or number keys. This keypad was introduced for quick data entry, especially for programs, which contained a lot of numerical data, like mathematical operations, etc.

The 3rd, 4th, and 5th rows are the typing keys. These are the keys, which are used for actual text typing. All kinds of alphabetical data are entered into the text editor through these keys.

The last row contains the command or control keys. They provide cursor control, and help to use shortcuts or leaps to certain internal applications when necessary. Some of the common control keys are:
  • Control (Ctrl)
  • Alternate (Alt)
  • Delete (Del)
  • Insert (Ins)
  • Escape (Esc)
  • Home
  • End
  • Page Up
  • Page Down
In addition to these, we also have other modifier keys, like Shift and a numerical pad on the right to feed numbers easily.
Internal Working of the Keyboards
The Key Matrix
The keyboard has its own processor and circuitry, a majority of which forms an important component called key matrix. The key matrix is a collection of circuits under the keyboard, which is broken at a specific point under every key, which results in making the circuit incomplete. When you press any particular key, it completes this circuit, thus, enabling the processor to determine the location of the key that was pressed.
Working of the Keys
Beneath each key, there is a little hole, which is at the top of a long, round bar. You might be able to observe this if you try to dismantle a key off the device and notice it. Now, when you press a key, this bar pushes through the hole, thus making contact with the circuit layers below. Inside the hole, there's a little tiny piece of rubber that prevents the key from moving down and pushes it back up when released. The springing factor of the keys is due to this reason.
Detection of Keypresses
When you type or press any key, a switch is pressed, which completes the circuit and allows a tiny amount of current to flow. A processor analyzes the position of the keys pressed and sends this information to the computer, where it is sent to something called the 'keyboard controller'. This controller processes the information that is sent by the keyboard's processor, and, in turn, sends it to the operating system (OS). The OS then checks this data to analyze if it contains any system level commands, like Ctrl+Shift+Esc, which is the keypress to bring up the Task Manager. If such system level commands are present, the computer executes them; if not, it forwards the information to the current application. The application then checks if the keypresses relate to commands in the application, like Ctrl+P, which is the keypress for the print command. Again, if there are such commands, they are executed first, and if not, then these keypresses are accepted as content or data. All this happens in a fraction of a second, so even if you press many keys, there is no lag in the system. What actually happens behind the scenes is that, there are three separate layers of plastic. Two of them are covered in electrically conducting metal tracks, and there's an insulating layer between them with holes in it. You can see dots at the places where the keys press the two conducting layers together. There are lines, which are electric connections allowing tiny electric currents to flow when the layers are pressed tight to one another by a key moving down from above.
Character Mapping
The key matrix has a corresponding chart or character map that is stored in the read-only memory (ROM) of the computer. When you press a key, the processor looks up the position of the circuit that was closed, or completed, with the character map, and determines which key was pressed. All the keys are mapped and stored in the memory. For example, in the character map, if just the location of the 'x' key is determined to be pressed, then the resulting lower case alphabet 'x' will be displayed or taken as a keypress, but if the locations of the 'Shift' and 'x' keys have been determined to be pressed, then the resulting uppercase character 'X' will be displayed or taken as a keypress.
To put it simply, keyboards use switches and circuits to change keystrokes to a format the computer understands. Every keyboard contains a processor that does the work of translating the keystrokes, or the keys pressed, to the computer.
Types of Switches
These are the two types of switches that are used to complete circuits in keyboards. Some of them use a capacitive process, instead of the mechanical one described above. In this process, the circuit is not broken and current passes through it continuously. However, each individual key has a plate attached to it that moves closer to the circuit when pressed. This movement registers with the key matrix, causing a change in the electric current flowing through the circuit. This change is then compared to the character map, and the location of the key pressed is determined.

Mechanical switches include rubber dome switches, membrane switches, metal contact switches, and foam element switches. Of these, rubber dome switches are the most common, as they have a good tactile response and are fairly resistant to spills and corrosion, in addition to being relatively inexpensive and easy to manufacture.
Though there are various types of keyboards, like wireless, Bluetooth, and USB keyboards, they all use the same principle of completing a circuit to determine a keypress, so as to perform a function.