StuBS
|
Handles mouse movements and clicks. More...
#include <device/mouse.h>
Public Member Functions | |
Mouse (unsigned max_x, unsigned max_y) | |
Constructor. | |
void | getPos (unsigned &x, unsigned &y) const |
Retrieve the current mouse position. | |
bool | isPressed (MouseButton btn) const |
Check if a given mouse button is pressed. | |
void | plugin () |
Initialization of the mouse. | |
bool | prologue () override |
Prologue of mouse interrupts. | |
void | epilogue () override |
Epilogue of mouse interrupts. | |
Public Member Functions inherited from Gate | |
Gate () | |
Constructor. | |
virtual | ~Gate () |
Destructor. | |
bool | is_queued () const |
Status about the epilogue. | |
void | set_queued (bool val) |
Set epilogue status. | |
Public Attributes | |
const unsigned | MAX_X |
Maximum X position of the mouse. | |
const unsigned | MAX_Y |
Maximum Y position of the mouse. | |
Private Member Functions | |
void | updatePos () |
Helper to update current position from state. | |
Private Attributes | |
Pointer | state |
Last state of the mouse. | |
unsigned | x |
Current X position of the mouse. | |
unsigned | y |
Current Y position of the mouse. | |
Additional Inherited Members | |
Protected Member Functions inherited from Queue< T, ContainerType >::Node | |
Node () | |
Handles mouse movements and clicks.
This class ensures correct initialization of the mouse and, above all, its interrupt handling.
Constructor.
Defines a virtual window for the mouse.
max_x | Maximum X position (excluding) for the mouse |
max_y | Maximum Y position (excluding) for the mouse |
|
inlineprivate |
Helper to update current position from state.
|
inline |
Check if a given mouse button is pressed.
btn | Button to check for press |
true
if button is currently pressed void Mouse::plugin | ( | ) |
Initialization of the mouse.
Initialization of the mouse and activation of the specific interrupt handling: The object will register itself at the Plugbox and configure the IOAPIC to receive the corresponding interrupts.
|
overridevirtual |
|
overridevirtual |
Epilogue of mouse interrupts.
The current position of the cursor is drawn on the screen using TextMode::showMouse(). Press and release events of the buttons are printed to the debug output.
Reimplemented from Gate.
|
private |
Last state of the mouse.
|
private |
Current X position of the mouse.
|
private |
Current Y position of the mouse.