|
Technical The KeyboardBasic keyboard operation undergoes several changes before it appears as you would expect when you press a key. The keyboard layout is commonly called the QWERTY design after the letters at the top left of the keyboard. PCs have a flexible software based keyboard system and you can change what pressing a key represents. Pressing the A key doesn't say to the computer this is the letter A because the hardware doesn't impose any meaning on key strokes. What actually happens when you press a key on your keyboard is that the keyboard recognises that you have pressed a key and makes a note of it. The keys are assigned an identifying number called a scan code. The keyboard tells the computer that something has happened through a hardware interrupt. The interrupt causes the processor to stop what it is doing and jump to a program. The keyboard interrupt handler finds out what has on the keyboard by sending the keyboard a command asking what happened which the keyboard responds to by telling the ROM BIOS what key was pressed via ports. The ROM BIOS issues a command code to a port address to which the keyboard responds and replies to by sending the scan code of the key to the port that the ROM BIOS reads. The keyboard must keep track of what key was pressed and wait until the ROM BIOS asks for it. The keyboard has a small memory large enough to record a number of separate keystrokes called a keyboard buffer. After the keyboard reports the key action to the processor the action is flushed from the keyboards buffer. The keyboard interrupt comes in at IRQ 1 at the hardware but is converted to IRQ 9 in the interrupt table. The keyboard also makes a note of when you release a key. Each separate key action is recorded by the keyboard, turned into an interrupt and sent to the ROM BIOS on command. To distinguish between a press and a release there are separate scan codes. The ROM BIOS is interrupted twice but can distinguish between you typing in the pound sign while holding down the shift key. The keyboard hardware controls the repeat action and keeps track of how long a key is held down for. If a key is held down for a certain period the keyboard hardware generates repeat key scan codes at a regular interval. The repeat key action is called the typematic feature. When the ROM BIOS interrupt handler receives a scan code from the keyboard and must interrupt that code, the ROM BIOS goes through several stages of analysis to decide how to interpret the key action. It checks to see if the action applies to any of the shift key types. If so the BIOS makes a note of the shift key state because it effects the interpretation of any following action. Next the BIOS would check to see if the action was any of the toggle keys which also effect the meaning of the action. For both key types the BIOS must keep track of the current state of these keys in memory. After checking shift and toggle keys the ROM BIOS needs to check for special keys and key combinations. Keyboard information flows in both directions and the complex mechanism of the keyboard needs its own I/O controller. The keyboard ROM BIOS routines also oversee some built in features like CTRL-ALT-DEL , print screen and system pause. Print screen and system pause are routines available to any program and provide a way to get at a service. Pause, however sends the ROM BIOS into a never ending loop. The machine still services interrupts but on completion handles control back to the keyboard interrupt handler which returns to its never ending loop until one of the keyboard regular keys is pressed again. If the key action goes through all of the the special key types and is not recognised it means that the key is an ordinary key and is assigned a meaning, providing the key is being pressed and not released. When an ordinary key is pressed the ROM BIOS recognises it and produces an ordinary character, such as A. It can have two meanings. One is that of the ordinary alphanumeric character A and the other is a control code, such as the function keys, the cursor keys or the home key. Under Windows it is possible to remap the keyboard through the International Applet in Control Panel, in the drop down box labelled keyboard layout. It is likely that you are using your own country layout which allows you to use the international characters.
|
If you have a question that is not answered on any of our pages why not post it on our community forum
[Welcome] [About
Us] [25 Pounds] [Search]
[Downloads] [Email]
[Site Map] [Forum]
Copyright © 1994-2002 scotsmist.co.uk