![]() |
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 0b00000001 |
| #define | MOD_RCTRL 0b00000010 |
| #define | MOD_CTRL 0b00000011 |
| #define | MOD_LSHIFT 0b00000100 |
| #define | MOD_RSHIFT 0b00001000 |
| #define | MOD_SHIFT 0b01001100 |
| #define | MOD_LALT 0b00010000 |
| #define | MOD_RALT 0b00100000 |
| #define | MOD_ALT 0b00110000 |
| #define | MOD_CAPSLOCK 0b01000000 |
| #define | MOD_NUMLOCK 0b10000000 |
| #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 () |
| 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 () |
| Gets the current modifiers (like lshift, rshift, etc.). | |
| uint8_t | getc () |
| Gets the last pressed char. | |
| int | getc_nonblock () |
| 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 0b00110000 |
Definition at line 27 of file keyboard.h.
| #define MOD_CAPSLOCK 0b01000000 |
Definition at line 28 of file keyboard.h.
| #define MOD_CTRL 0b00000011 |
Definition at line 21 of file keyboard.h.
| #define MOD_LALT 0b00010000 |
Definition at line 25 of file keyboard.h.
| #define MOD_LCTRL 0b00000001 |
Definition at line 19 of file keyboard.h.
| #define MOD_LSHIFT 0b00000100 |
Definition at line 22 of file keyboard.h.
| #define MOD_NUMLOCK 0b10000000 |
Definition at line 29 of file keyboard.h.
| #define MOD_RALT 0b00100000 |
Definition at line 26 of file keyboard.h.
| #define MOD_RCTRL 0b00000010 |
Definition at line 20 of file keyboard.h.
| #define MOD_RSHIFT 0b00001000 |
Definition at line 23 of file keyboard.h.
| #define MOD_SHIFT 0b01001100 |
Definition at line 24 of file keyboard.h.
| uint8_t getc | ( | ) |
Gets the last pressed char.
| int getc_nonblock | ( | ) |
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); |