Skip to content
【☢】 BitHardware.top ▷ Hardware, Reviews, News, Tutorials, Help post

How the PC detects each key you press on the keyboard at all times

Keyboards have been in the world of computing since before the appearance of the first personal computers, since they were used in the terminals of minicomputers. Have you ever wondered how the PC can tell which key on the keyboard you have pressed? It is something simple, but in case you have ever been curious about it, we will explain it to you.

The keyboard is undoubtedly the oldest input peripheral in computers, it has been used since before the appearance of the mouse and is still used today. However, it has not evolved much since then.

Keyboards precede PC

At the end of the 60s the first terminals appeared, these consisted of a keyboard and a screen that were remotely connected to a large computer in the same room. A simile today would be when we run a remote application in the cloud.

These terminals did not use complex graphic systems, but rather their environments were purely text-based, but required a keyboard to input commands, which were seen on the screen in front of the user. The terminals did not process anything, and the computer in the room only processed the written code or the list of commands when the enter key was hit on the keyboard.

So in the terminal there was a process that what it did was show each character on the screen in real time, the character sample was not carried out using any type of processing in the medium.

How the keyboard detects the pressed key

Matrix Key Keyboard

Actually, it is the keyboard itself that detects the key that we have pressed, in each keyboard there is a matrix of circuits where each key is connected to a matrix of cables. From which line and column of the matrix is ​​active at any given time, the keyboard sends one code or another, each different code corresponding to a specific character.

In the first terminals and in the first personal computers this code was the memory address in a character ROM. From where the character was selected and this same ROM sent the character already previously stored in it to the video output. The problem with this method? It was not possible to change the font or the size of the characters.

As PCs became more complex, simple character ROMS were stopped and a set of fonts in different sizes and styles were used. This was mostly possible due to the increased capabilities of VRAM, but the system used remains the same as it was then and has not evolved.

Of course, keyboards now usually incorporate a small internal memory that stores the last keys pressed and in most cases prevents indiscriminate keystrokes from accidentally reaching the screen. So they are somewhat more advanced than those of yesteryear, but it is a peripheral that has hardly evolved since then.