Skip to main content

Module keyboard

Module keyboard 

Source
Expand description

PS/2 Keyboard driver (inspired by MaestroOS keyboard.rs)

Handles IRQ1 keyboard interrupts, reads scancodes from port 0x60, and converts them to characters for the VGA console.

Structs§

KeyboardState
Keyboard state

Constants§

KEY_DOWN
KEY_END
KEY_HOME
KEY_LEFT
KEY_RIGHT
KEY_UP

Statics§

KEYBOARD
Global keyboard state

Functions§

add_to_buffer
Add a character to the keyboard buffer (called from IRQ context).
handle_scancode
Handle a keyboard IRQ (called from interrupt handler)
handle_scancode_raw
Same as handle_scancode but takes a pre-read scancode byte.
has_input
Check if keyboard buffer has data (task context only).
read_char
Get a character from the keyboard buffer (non-blocking, task context only).