Appearance
MouseAPI
cpp
#include <VirtualC64.h>cpp
class MouseAPIDefined in VirtualC64.h:930
Mouse Public API
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 VirtualC64.h:940
Returns the component's current configuration.
setXY
cpp
void setXY(double x, double y)Defined in VirtualC64.h:946
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 VirtualC64.h:952
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 VirtualC64.h:957
Triggers a mouse button event
Parameters
| Parameter | Type | Description |
|---|---|---|
action | GamePadAction | The triggered event |
detectShakeXY
cpp
bool detectShakeXY(double x, double y)Defined in VirtualC64.h:968
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 VirtualC64.h:981
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. |