![]() |
FrostWing
A lightweight raw-control operating system.
|
The PS/2 Keyboard interface code. More...


Go to the source code of this file.
Macros | |
| #define | MOD_LCTRL 0x01U |
| #define | MOD_RCTRL 0x02U |
| #define | MOD_CTRL 0x03U |
| #define | MOD_LSHIFT 0x04U |
| #define | MOD_RSHIFT 0x08U |
| #define | MOD_SHIFT 0x4CU |
| #define | MOD_LALT 0x10U |
| #define | MOD_RALT 0x20U |
| #define | MOD_ALT 0x30U |
| #define | MOD_CAPSLOCK 0x40U |
| #define | MOD_NUMLOCK 0x80U |
| #define | CUR_UP -1 |
| #define | CUR_DOWN -2 |
| #define | CUR_LEFT -3 |
| #define | CUR_RIGHT -4 |
| #define | KB_BUFFER_SIZE 256 |
Functions | |
| char | scancode_to_char (int scancode, bool uppercase) |
| Converts the scancode to character. | |
| void | keyboard_init (void) |
| Initalizes the RingBuffer to store the characters. | |
| void | process_keyboard (InterruptFrame *frame) |
| This is a function that is ran even when the sleep() function is called. | |
| uint8_t | getmodifiers (void) |
| Gets the current modifiers (like lshift, rshift, etc.). | |
| uint8_t | getc (void) |
| Gets the last pressed char. | |
| int | getc_nonblock (void) |
| Non-blocking getc from keyboard buffer. | |
| void | keyboard_flush_buffer (void) |
| Clears pending keyboard input so stale keypresses are discarded. | |
| int | handle_char_from_scancode (uint8_t data) |
| Converts the scancode passed to it to ASCII characters. | |
The PS/2 Keyboard interface code.
Definition in file keyboard.h.
| #define CUR_DOWN -2 |
Definition at line 32 of file keyboard.h.
| #define CUR_LEFT -3 |
Definition at line 33 of file keyboard.h.
| #define CUR_RIGHT -4 |
Definition at line 34 of file keyboard.h.
| #define CUR_UP -1 |
Definition at line 31 of file keyboard.h.
| #define KB_BUFFER_SIZE 256 |
Definition at line 36 of file keyboard.h.
| #define MOD_ALT 0x30U |
Definition at line 27 of file keyboard.h.
| #define MOD_CAPSLOCK 0x40U |
Definition at line 28 of file keyboard.h.
| #define MOD_CTRL 0x03U |
Definition at line 21 of file keyboard.h.
| #define MOD_LALT 0x10U |
Definition at line 25 of file keyboard.h.
| #define MOD_LCTRL 0x01U |
Definition at line 19 of file keyboard.h.
| #define MOD_LSHIFT 0x04U |
Definition at line 22 of file keyboard.h.
| #define MOD_NUMLOCK 0x80U |
Definition at line 29 of file keyboard.h.
| #define MOD_RALT 0x20U |
Definition at line 26 of file keyboard.h.
| #define MOD_RCTRL 0x02U |
Definition at line 20 of file keyboard.h.
| #define MOD_RSHIFT 0x08U |
Definition at line 23 of file keyboard.h.
| #define MOD_SHIFT 0x4CU |
Definition at line 24 of file keyboard.h.
| uint8_t getc | ( | void | ) |
Gets the last pressed char.
| int getc_nonblock | ( | void | ) |
Non-blocking getc from keyboard buffer.
| int handle_char_from_scancode | ( | uint8_t | data | ) |
Converts the scancode passed to it to ASCII characters.
| data | Scancode |
| char scancode_to_char | ( | int | scancode, |
| bool | uppercase ) |
Converts the scancode to character.
| scancode | usually inb(0x60); |