Handles mouse movements and clicks.
More...
#include <device/mouse.h>
|
| 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.
|
|
void | trigger () |
| Handling of mouse interrupts.
|
|
| Gate () |
| Is this epiloque already marked for execution Add a member that stores the information whether a Gate has already been queued.
|
|
virtual | ~Gate () |
| Destructor.
|
|
|
const unsigned | MAX_X |
| Maximum X position of the mouse.
|
|
const unsigned | MAX_Y |
| Maximum Y position of the mouse.
|
|
|
void | updatePos () |
| Helper to update current position from state.
|
|
|
Pointer | state |
| Last state of the mouse.
|
|
unsigned | x |
| Current X position of the mouse.
|
|
unsigned | y |
| Current Y position of the mouse.
|
|
Handles mouse movements and clicks.
This class ensures correct initialization of the mouse and, above all, its interrupt handling.
◆ Mouse()
Mouse::Mouse |
( |
unsigned |
max_x, |
|
|
unsigned |
max_y |
|
) |
| |
|
inlineexplicit |
Constructor.
Defines a virtual window for the mouse.
- Parameters
-
max_x | Maximum X position (excluding) for the mouse |
max_y | Maximum Y position (excluding) for the mouse |
◆ updatePos()
void Mouse::updatePos |
( |
| ) |
|
|
inlineprivate |
Helper to update current position from state.
◆ getPos()
void Mouse::getPos |
( |
unsigned & |
x, |
|
|
unsigned & |
y |
|
) |
| const |
|
inline |
Retrieve the current mouse position.
- Parameters
-
x | Reference to variable for the X position (0 ≤ x < MAX_X) of the mouse |
y | Reference to variable for the Y position (0 ≤ y < MAX_Y) of the mouse |
- Optional:
- Implement method
◆ isPressed()
Check if a given mouse button is pressed.
- Parameters
-
btn | Button to check for press |
- Returns
true
if button is currently pressed
- Optional:
- Implement method
◆ 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.
- Note
- The mouse interrupts should be configured as level triggered.
- Optional:
- Implement method
◆ trigger()
Handling of mouse interrupts.
Processes interrupts triggered by the mouse.
- Optional:
- Implement Method
Implements Gate.
◆ state
Current X position of the mouse.
Current Y position of the mouse.
◆ MAX_X
const unsigned Mouse::MAX_X |
Maximum X position of the mouse.
◆ MAX_Y
const unsigned Mouse::MAX_Y |
Maximum Y position of the mouse.
The documentation for this class was generated from the following files: