Question:
what actually happens when I type on my keyboard...?
Makaveli007
2009-07-16 14:34:24 UTC
I'm learning programming for the first time (starting with C for beginner) but I first I want to understand exactly what happens when I type the key, let's say "b" on my keyboard and seeing letter "b" appear on a notepad for instance.

My guess is this and I'm not sure to what extent it is correct:

First, a computer is, physically speaking, nothing but electricity and circuitry (matter; electronic components such as resistors, capacitors etc and electrical power which comes from the battery/wall and finally the way all these are connected to one another)

1. The keyboard, being an electronic device, needs electricity in order to work so it is powered by the computer through the USB port.

2. By pressing any key ("be" in our case), I'm actually closing a circuit which makes some current/voltage flow (high for 1 and low for 0)

3. Some programs (Operating system which then communicates to notepad God knows how) convert this series of high's and low's or 0's and 1's into what I see on my screen as letter "b" on the notepad.

Am I close to the reality of computing?

I mean how does the computer know that I have actually pressed the key "b" on the keyboard and not "a", does every key send some sort of special current or something? This part I need clarifying the most!

Does this have anything to do with "Hex"?

Thank you.
Eight answers:
sewrobb
2009-07-16 15:08:21 UTC
When you press a key on a keyboard it sends a combination of binary code to the keyboard module on the motherboard which in turns deciphers it and then sends it to the video card through various circuits to display it.



If you want how it is made up download this free program called Extended Character Map. It will show every character and how it is made up in Decimal, Hex, Oct and Binary.



http://www.pricelesswarehome.org/WoundedMoon/win32/extendedcharactermap141.html
George H
2009-07-16 15:00:59 UTC
Your very close! your keyboard is sort of a computer in itself. it uses a hex decimal code which are the "0 and 1" in a 7 bit array. each key has its own 7 bit code that is standard with key boards. When a key is pressed it sends that coded signal to your computer which in turn sends it to the RAM then to the Processor then back to the ram and at the same time to the screen as the letter or figure of the key you depressed. Actually, on the key board its the placement of the buttons that send the signal. I had a friend that removed some keys from his key board to clean it and replaced them in the wrong place! he was horrified when the letter he clearly pressed was not what showed up on the screen! we looked at another key board and saw the problem and of course fixed it. by the way..if ya want to mess with someones head..move his keys around! it will drive them crazy! Keep studying!
2009-07-17 00:12:50 UTC
Basically the PC is run by the CPU (Central Processing Unit) . IT is continuously cycling through a set of instructions at the speed it is clocked at. I am not sure how many instructions there are, but it is not many. The motherboard is usually a bit slower and therefore halves the CPU speed (misses out every one in two cycles)This is why a Mac is faster. It may have a slower clock speed but it has a smaller instruction set called RISC (reduced Instruction set computer). The CPU has many connection pins for input/output of digital signals. As you say on or off/ power or no power. Now one of these instructions is called an interupt. Every time the CPU cycles through the instructions it queries if this interupt is receiving a signal or not. If for example, a key is pressed the interupt will be triggered. Of course something (presumably the keyboard controller, is scanning the whole keyboard loads of times every millisecond and again is relying on an interupt) Now, instead of going to the next instruction in the cycle it branches off to another circuit, possibly through the memeory where the fonts are stored and then to the screen print instruction set.Once that 'job' has been done the CPU continues it's normal cycle again. Of course it doesn't actually work like this because 1. The CPU multi tasks and 2. it has a lot of stuff stored in its cache memory. While it is attending to that interupt it is returning, back and forth, to the cycle, doing other jobs and seeing to other interupts.

To put it another way lets say you are sitting in achair reading a book. Without realising it you are continually and subconciously listening to see if the 'phone or the doorbell is ringing. If the 'phone rings you pick it up. (more likely you instruct the wife to answer it, get on with reading the book, but remembering you told the wife and waiting for her to report back that sjhe has finished that task!You are still listening to see if the doorbell is ringing or not and memorising where you were in the book. You talk on the phone, still listening for doorbell. Finish phone call, listen foor doorbell, go back to reading, scrap memorising where you were in book. While you are doing this you are also doing a thousand other things.

The CPU is very powerfull: It has memory, it can add up huge numbers at great speed (and therefore multiply and everything else) and it can use logic (IF, AND, OR etc.). It is also connected to other powerful and fast task-specific MPUs (Micro Processor Units) such as Graphic, Video, Harddrive controller, I/O (input output) chips. The I/O chip looks after input and output. Input would be the keyboard, mouse etc., Output would be screen (video controller) or printer etc.

So the CPU 'knows' to pass requests for different tasks to these other parts of the PC.

You should look at a schematic diagram of the motherboard to get an idea of the flow of data around a PC

The basic requirements of the computer to be 'live' are the CPU, Power, and a BIOS (Basic Input Output System which is permanently held in ROM). You then latch on everything else. Firstly a DOS (Disc Operating System) which can read and write to a hard drive. On the hard drive you put your OS (Operating System) which would now be MS Windows. Strangely enough a modern PC still works exactly the same as the original IBM PC. On start up it goes through the same processes as it always has done, although more hardware and software has been added on top. You can still run a PC in Command Mode (without the operating system). You can see this if you go to Start/All programs/Accessories/Command Prompt. Although in this case it is still running through Windows. Somehow you can get the PC to run in Command prompt without starting Windows and you will see you have no GUI (Graphical User Interface), just text commands. In a way the system is very simple because, as you say, it all works on binary (on or off, zero or one).
2009-07-16 14:59:16 UTC
i have taken apart many keyboards to clean them.



not 100% sure on how they work but there are 2 circuit sheets inside, a circuit board with micro processing chips on there. when you press a button, a small pressure pad compresses 2 pressure points together which send out a unique signal to the circuitry, which then interpret it into a series of 1's and 0 which the computer can recognise as a letter or number or combination of keys.



have you tried going onto www.howstuffworks.com and typing in 'how a keyboard works?' ?



they have all sorts of expenations simple and very indepth ones.



Edit_



CPU doesnt handle the keyboard. i think it's the north or south bridge chipset.
2015-01-24 19:09:58 UTC
Binary options let users trade in currency pairs and stocks for various predetermined time-periods, minimal of which is 30 seconds. Executing trades is straightforward. The system uses user-friendly interfaces, which even an 8 years old kid, can operate without having to read any instructions. But winning trades is Not easy.

Binary trading is advertised as the only genuine system that lets users earn preposterous amounts of money in ridiculously short period of time. Advertisers try to implicate as if you can make $350 every 60 seconds; if it was true then binary trading would truly be an astonishing business.

However, does it make any sense? Can every trader make tons of money in binary trading? Who is actually paying all the money or the profit to traders?

The first challenge is finding a trustworthy binary broker; secondly, you need to find a binary trading strategy, which you can use to make profits consistently. Without an effective trading strategy, there is no way you can make money in this business.

Learning a profitable trading strategy is possible, You should watch this presentation video https://tr.im/16635

It's probably the best way to learn how to win with binary option
2009-07-16 14:44:26 UTC
Noo thats not how it works at all. the little people live under keys and they get bashed on the head and the write a memo to other little people so you can see it on the screen.



Don't swear when a key sticks the little people are eating toffee.
fairy
2016-05-02 01:50:23 UTC
If you want to make money with binary options then this detailed educational articles and strategy guides. Go here https://tr.im/TroUR

These will teach you to efficiently trade financial assets and increase your winning probabilities. You can implement these strategies at binary options brokers. The idea is to always choose legit and reputable brokers to avoid being scammed
2016-02-26 08:24:25 UTC
When you press b, little circuitry on the keyboard gets the signal then processes it. Then it determines that you pressed "b". Then it sends the signal to the computer that "b" is pressed. On the computer, it process the signal and sends it to the master program. Then that master program checks if it's meant for itself. Since master program does not deal with simple keys such as "b", it sends the signal to the child program. That child program processes, determines it's not meant for itself, sends the signal to it's child program, until it reaches the notepad. Notepad then displays "b" on the screen.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...