9#ifndef MAX_OS_DRIVERS_PERIPHERALS_MOUSE_H
10#define MAX_OS_DRIVERS_PERIPHERALS_MOUSE_H
22namespace MaxOS::drivers::peripherals {
96 void handle_interrupt()
final;
98 uint8_t m_buffer[3] = { };
100 uint8_t m_buttons = 0;
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 mouse button is pressed, holds the button that was pressed.
uint8_t button
The button that was pressed.
Driver for the PS/2 mouse, manages the mouse and triggers events when the mouse moves or a button is ...
void activate() final
activate the mouse
MouseDriver()
Constructs a new MouseDriver object and registers it as an interrupt handler for interrupt 0x2C.
string device_name() final
Get the name of the device.
Handles events that are triggered by the mouse driver.
virtual void on_mouse_down_event(uint8_t button)
Called when the mouse is pressed.
virtual void on_mouse_up_event(uint8_t button)
Called when the mouse is released.
virtual void on_mouse_move_event(int8_t x, int8_t y)
Called when the mouse is moved.
common::Event< MouseEvents > * on_event(common::Event< MouseEvents > *) override
Handles the triggered event and calls the appropriate function.
Event that is triggered when the mouse moves, holds the x and y coordinates.
int8_t x
The x coordinate of the mouse.
int8_t y
The y coordinate of the mouse.
Event that is triggered when a mouse button is released, holds the button that was released.
uint8_t button
The button that was released.
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.
MouseEvents
The different types of mouse events that can be triggered.
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.