⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

Module keyboard

Module keyboard 

Source
Expand description

PS/2 keyboard driver for x86_64.

Reads scancodes from I/O port 0x60, decodes them via the pc_keyboard crate (ScancodeSet1, US 104-key layout), and pushes decoded ASCII bytes to a lock-free ring buffer. The shell reads from this buffer.

On non-x86_64 architectures, all functions are no-op stubs.

Constants§

KEY_DELETE
Single-byte key code for Delete (GUI mode).
KEY_DOWN
Single-byte key code for Down arrow (GUI mode).
KEY_END
Single-byte key code for End (GUI mode).
KEY_HOME
Single-byte key code for Home (GUI mode).
KEY_LEFT
Single-byte key code for Left arrow (GUI mode).
KEY_RIGHT
Single-byte key code for Right arrow (GUI mode).
KEY_UP
Single-byte key code for Up arrow (GUI mode).
MOD_ALT
Bitmask: Alt is held.
MOD_CTRL
Bitmask: Ctrl is held.
MOD_SHIFT
Bitmask: Shift is held.
MOD_SUPER
Bitmask: Super/Win is held.

Functions§

get_modifiers
Get the current modifier key bitmask.
handle_scancode
Handle a scancode from the PS/2 keyboard interrupt (vector 33).
init
Initialize the PS/2 keyboard driver.
is_initialized
Check if the keyboard driver has been initialized.
read_key
Read a decoded key byte from the keyboard buffer (non-blocking).
set_gui_mode
Enable or disable GUI key encoding mode.