OOStuBS - Technische Informatik II (TI-II)
2.4
|
(PS/2) Tastaturtreiber Mehr ...
#include <keyctrl.h>
Öffentliche Typen | |
enum | Leds { caps_lock = 4, num_lock = 2, scroll_lock = 1 } |
LED names. Mehr ... |
Öffentliche Methoden | |
Key | key_hit () |
get the last pressed key | |
Keyboard_Controller () | |
Default constructor, turns all LEDs off and set speed and delay maximal. | |
void | reboot () |
reboots the computer | |
void | set_led (Leds led, bool on) |
switch the specified LED of the keyboard on or off. | |
void | set_repeat_rate (unsigned char speed, unsigned char delay) |
set the speed and delay of repeats of the keyboard. |
Private Typen | |
enum | Commands { cmd_set_led = 0xed, cmd_set_speed = 0xf3, cmd_cpu_reset = 0xfe } |
keyboard commands Mehr ... | |
enum | Decodes { break_bit = 0x80, prefix1 = 0xe0, prefix2 = 0xe1 } |
Decoding constants. Mehr ... | |
enum | Responses { ack = 0xfa } |
keyboard responses Mehr ... | |
enum | StatusMasks { outb = 0x01, inpb = 0x02, auxb = 0x20 } |
Bit-Maske für das Status-Register. Mehr ... |
Private Methoden | |
void | get_ascii_code () |
convert the received scancode and modfier bits to an ascii char | |
bool | key_decoded () |
interpret the reveived scancode and modifier bits |
Private Attribute | |
unsigned char | code |
der zuletzt eingelesene Scan-Code | |
const IO_Port | ctrl_port |
"Control Port" des Tastaturkontrollers | |
const IO_Port | data_port |
"Daten Port" des Tastaturkontrollers | |
Key | gather |
Key to save the last input. | |
char | leds |
variable containing the current led status | |
unsigned char | prefix |
der Vorsatz/Prefix des aktuellen Scan-Codes |
Statische, private Attribute | |
static unsigned char | alt_tab [] |
Scancode translation table if alt is pressed. | |
static unsigned char | asc_num_tab [] |
Scancode translation table to ascii for numeric block. | |
static unsigned char | normal_tab [] |
Scancode translation table without modifier. | |
static unsigned char | scan_num_tab [] |
Scancode translation table to special keys for numeric block. | |
static unsigned char | shift_tab [] |
Scancode translation table if shift is pressed. |
(PS/2) Tastaturtreiber
Diese Klasse ist eine Abstraktion des Tastaturkontrollers des Computers. Historisch bedingt ist dieser nicht ausschließlich für die Tastatur und Maus zuständig. Auch ein CPU-Neustart, PC-Lautsprecher et cetera werden durch ihn gesteuert.
Früher war er ein eigener Chip, heutzutage ist er meist Teil eines AIP-Chips (Advanced Integrated Peripheral).
|
private |
|
private |
|
private |
|
private |
Keyboard_Controller::Keyboard_Controller | ( | ) |
Default constructor, turns all LEDs off and set speed and delay maximal.
Definiert in Zeile 179 der Datei keyctrl.cc.
|
private |
convert the received scancode and modfier bits to an ascii char
Determins the ASCII code of a key according to the scancode and modifier bits.
Determins the ASCII code of a key using the scancode and modifier bits.
Definiert in Zeile 150 der Datei keyctrl.cc.
|
private |
interpret the reveived scancode and modifier bits
Interpretes the make and break code of the keyboard an returns an valid ASCII code, scancode and information about modifier keys like SHIFT and CTRL.
Definiert in Zeile 53 der Datei keyctrl.cc.
Key Keyboard_Controller::key_hit | ( | ) |
get the last pressed key
Is used to get the information of the pressed key after is has been pressed. If a scancode and ASCII code could not be determined an invalid key is returned.
Definiert in Zeile 212 der Datei keyctrl.cc.
void Keyboard_Controller::reboot | ( | ) |
reboots the computer
This uses a keyboard controller command.
Definiert in Zeile 199 der Datei keyctrl.cc.
void Keyboard_Controller::set_led | ( | Leds | led, |
bool | on | ||
) |
switch the specified LED of the keyboard on or off.
led | specifies the LED turned on or off |
on | if TRUE LED is turned on otherwise off |
Definiert in Zeile 250 der Datei keyctrl.cc.
void Keyboard_Controller::set_repeat_rate | ( | unsigned char | speed, |
unsigned char | delay | ||
) |
set the speed and delay of repeats of the keyboard.
speed | defines speed of a repeat (0 fast - 31 slow) |
delay | defines delay of a repeat (0 minimal - 7 maximal) |
Definiert in Zeile 230 der Datei keyctrl.cc.
|
staticprivate |
Scancode translation table if alt is pressed.
|
staticprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticprivate |
Scancode translation table without modifier.
|
private |
|
staticprivate |
|
staticprivate |
Scancode translation table if shift is pressed.