How Do Computers Know Which Key We’re Pressing?

How do our computers, which we use for hours every day, know which key we press on the keyboard? This process is actually more complicated than you might imagine.

While computers have already become the most basic tools in our lives, their dominance in our lives is increasing day by day. So, how is it understood by these devices that we press a key on our computer every day? How do computers know when we press a key and it displays it as a letter or an action?

The answer to this question is actually changing day by day with the advancement of computer technology. But the basic logic actually stays the same. Let’s see what a computer does when we press a key on the keyboard. Let’s explain in detail step by step.

What do computers do when you press a key on the keyboard?

It is not just the computer or a component on the keyboard that we see on the screen the answer to which key we press on the computer keyboard. Actually In this process, which lasts even less than milliseconds, Each component plays a role, from your computer’s motherboard to its processor and graphics card. The processes that take place from the moment we press the first button are as follows:

We pressed the button with our finger: What happens first?

keyboard

As soon as you press the ‘A’ key on your keyboard with your finger, there is a movement in the circuit under this key. The mechanism under the key you press comes into contact with the circuit board at the point just below the circuit on the keyboard. As a result of this contact A current is generated in the keyboard circuit. In other words, the key you press actually functions as a switch in the keyboard circuit.

There is a current, so how does the computer detect this current?

keyboard

With the electric current formed, the ‘internal’ in keyboards or computerskeyboard controller‘ Activated. This controller is built into special input/output (I/O) parts (especially laptops) found on motherboards in today’s computers or directly in the keyboards themselves. The current that occurs when you press the keyboard is captured by this controller.

According to the current it captures, the controller ‘scan code‘ is forming. Each key on your keyboard has a unique scan code. This code, consisting of only 0s and 1s, is sent to your computer as an electrical pulse or signal, via a USB cable, a direct circuit if it is a laptop, or a receiver that you plug into your computer if it is Bluetooth.

Where is this code sent? Of course, to the processor, which is the brain of the computer:

processor

The scan code reaches the processor of our computer. The processor takes this code and interprets it through the operating system it manages. The operating system checks whether a key has been pressed on a keyboard countless times per second. In fact, every single timeHas the button been pressed?” he asks. When you press a button and send a scan code to your processor, the answer to this question is ‘Yes!’ and proceed to the next steps.

The operating system initiates an ‘event’ after receiving this scancode. In this event, the system Scan code consisting of 0s and 1sconverts it to Unicode code or ASCII, where each character is assigned a numeric value and is used as a standard in all technological devices today. The code no longer consists of 0s and 1s, but a much richer structure.

What the key does now depends on the apps:

keyboard

The codes you send with the key or keys you press are interpreted by the computer and operations are performed in a predetermined way. For example, if you pressed only one letter, the information that this letter was pressed is sent to the application you are using. The interpretation of this is also up to practice.

For example, Microsoft Word transfers this command as printing the letter ‘a’ when you press the ‘A’ key, while Valorant interprets this key as we want to move our character to the left.

But still nothing is reflected on our screen? Here it will now reflect:

the letter 'A

After all these steps, the application interprets the code presented by the operating system within itself, and transforms this interpretation into a code consisting of 0s and 1s. commented code, is sent back to the processor. The processor, on the other hand, takes this code as it is and sends it to the external or internal graphics processor. The graphics processor sends this code to the monitor as electrical signals. And we see the equivalent of this electrical signal with the image reflected on our monitor.

Of course, these pixels we see on our monitor actually emerge as a result of a very different process. To summarize this process, it would be a little simpler to go through Microsoft Word again. Our computer, after determining which letter to enter in Word, checks which font it is. These signals are then transmitted to the monitor “Look, you’re going to show the letter ‘a’ like this” it sends out electrical signals.

Each and every event we have described above is not actually happening through codes, but by electrical signals. The codes are in the electrical signals that we have created for these signals. will make the voltage easier to read by human was the system. The only thing that components in our computers understand and interpret is changes in voltage.

RELATED NEWS

For the Uninitiated: How Does a Computer Work?


source site-39