Appearance
MouseAPI
cpp
#include <VAmiga.h>cpp
class MouseAPIDefined in VAmiga.h:1673
API of a mouse.
Public Methods
| Return | Name | Description |
|---|---|---|
const MouseConfig & | getConfig const | Returns the component's current configuration. |
void | setXY | Moves the mouse |
void | setDxDy | Moves the mouse |
void | trigger | Triggers a mouse button event |
bool | detectShakeXY | Feeds a coordinate into the shake detector. |
bool | detectShakeDxDy | Feeds a coordinate into the shake detector. |
getConfig
const
cpp
const MouseConfig & getConfig() constDefined in VAmiga.h:1683
Returns the component's current configuration.
setXY
cpp
void setXY(double x, double y)Defined in VAmiga.h:1689
Moves the mouse
Parameters
| Parameter | Type | Description |
|---|---|---|
x | double | New absolute horizontal coordinate |
y | double | New absolute vertical coordinate |
setDxDy
cpp
void setDxDy(double dx, double dy)Defined in VAmiga.h:1695
Moves the mouse
Parameters
| Parameter | Type | Description |
|---|---|---|
dx | double | Relative horizontal mouse movement |
dy | double | Relative vertical mouse movement |
trigger
cpp
void trigger(GamePadAction action)Defined in VAmiga.h:1700
Triggers a mouse button event
Parameters
| Parameter | Type | Description |
|---|---|---|
action | GamePadAction | The triggered event |
detectShakeXY
cpp
bool detectShakeXY(double x, double y)Defined in VAmiga.h:1711
Feeds a coordinate into the shake detector.
The shake detector keeps track of the transmitted coordinates and scans for rapid movements caused by shaking the mouse.
Returns
true iff a shaking mouse has been detected.
Parameters
| Parameter | Type | Description |
|---|---|---|
x | double | Current horizontal mouse position. |
y | double | Current vertical mouse position. |
detectShakeDxDy
cpp
bool detectShakeDxDy(double dx, double dy)Defined in VAmiga.h:1724
Feeds a coordinate into the shake detector.
The shake detector keeps track of the transmitted coordinates and scans for rapid movements caused by shaking the mouse.
Returns
true iff a shaking mouse has been detected.
Parameters
| Parameter | Type | Description |
|---|---|---|
dx | double | Current horizontal mouse position, relative to the previous position. |
dy | double | Current vertical mouse position, relative to the previous position. |