9#ifndef MAX_OS_DRIVERS_PERIPHERALS_KEYBOARD_H
10#define MAX_OS_DRIVERS_PERIPHERALS_KEYBOARD_H
24namespace MaxOS::drivers::peripherals {
85 exclamationMark =
'!',
91 slantedApostrophe =
'`',
119 openSquareBracket =
'[',
120 closeSquareBracket =
']',
121 openCurlyBracket =
'{',
122 closeCurlyBracket =
'}',
181 numberPadForwardSlash,
355 numberPadLock = 0x45,
356 numberPadForwardSlash = 0x35,
357 numberPadMultiply = 0x37,
358 numberPadMinus = 0x4A,
372 openSquareBracket = 0x1A,
373 closeSquareBracket = 0x1B,
378 numberPadSeven = 0x47,
379 numberPadEight = 0x48,
380 numberPadNine = 0x49,
381 numberPadPlus = 0x4E,
397 numberPadFour = 0x4B,
398 numberPadFive = 0x4C,
417 numberPadThree = 0x51,
418 numberPadEnter = 0x1C,
431 numberPadZero = 0x52,
432 numberPadFullStop = 0x53
Defines classes and structures for handling the Advanced Programmable Interrupt Controller (APIC) in ...
Manages the m_handlers for a type of event, raises events and calls the m_handlers.
Used to store information about an event, has a type and a return value.
Stores the left, top, width and height of a rectangle.
base class for all drivers, handles the activation, deactivation, initialisation and reset of the dri...
Event that is triggered when a key is pressed.
KeyCode key_code
The key code of the key that was pressed.
KeyboardState keyboard_state
The state of the keyboard when the key was pressed.
Event that is triggered when a key is released.
KeyboardState keyboard_state
The state of the keyboard when the key was released.
KeyCode key_code
The key code of the key that was released.
Driver for the Keyboard Controller, manages the events and the keyboard state.
void handle_interrupt() final
deactivate the keyboard driver
KeyboardDriver()
Construct a new Keyboard Driver object, registering it as an interrupt handler for interrupt 0x21.
string device_name() final
Get the device name.
void activate() final
activate the keyboard driver
Handles the events that are triggered by the Keyboard Driver.
virtual void on_key_up(KeyCode, const KeyboardState &)
Handle the key up event.
virtual void on_key_down(KeyCode, const KeyboardState &)
Handle the key down event.
common::Event< KeyboardEvents > * on_event(common::Event< KeyboardEvents > *) override
Handle the trigger of an event.
Interprets the scan codes from the keyboard for the EN_US keyboard layout.
KeyboardInterpreterEN_US()
Construct a new Keyboard Interpreter for the EN_US layout.
KeyCodeEN_US
The scan codes for the EN_US keyboard layout.
void on_stream_read(uint8_t scan_code) final
Handle the key down event.
Interprets the scan codes from the keyboard.
KeyboardInterpreter()
Construct a new Keyboard Interpreter object.
bool m_next_is_first_extended_code
If true, the next code should be interpreted as an extended code (set when receiving 0xE0)
void on_key_read(bool, const KeyboardState &, KeyCode)
Handle the key event.
uint8_t m_extended_scan_code_bytes
How many bytes are left to read for the current extended scan code.
uint16_t m_extended_code_buffer
The storage for scan codes that take more than one byte.
KeyboardState m_keyboard_state
The current state of what special keys are pressed on the keyboard.
Holds the state of the keyboard.
bool left_control
Is the left control key pressed.
bool left_shift
Is the left shift key pressed.
bool right_control
Is the right control key pressed.
bool number_pad_lock
Is number pad lock enabled.
bool scroll_lock
Is scroll lock enabled.
bool caps_lock
Is caps lock enabled.
bool right_alt
Is the right alt key pressed.
bool left_alt
Is the left alt key pressed.
bool right_shift
Is the right shift key pressed.
Handles a certain interrupt number.
Defines a base Driver class and DriverManager for managing drivers.
Defines classes for handling events and event managers.
Defines a InterruptManager and InterruptHandler for managing hardware and software interrupts.
ScanCodeType
The type of scan code being sent by the keyboard.
KeyCode
A mapping of key codes to their values.
@ f1
OTHER CODES THAT ARE NOT CHARACTERS ///.
KeyboardEvents
The events that can be triggered by the Keyboard Driver.
Defines a Map class for storing key-value pairs.
Defines classes for handling hardware communication ports (8, 16, and 32 bit)
Defines a String class for dynamically sized strings with various operations.
Defines a Vector class for dynamically storing an array of elements.