Skip to content

MouseAPI ​

cpp
#include <VirtualC64.h>
cpp
class MouseAPI

Defined in VirtualC64.h:930

Mouse Public API

Public Methods ​

ReturnNameDescription
const MouseConfig &getConfig constReturns the component's current configuration.
voidsetXYMoves the mouse
voidsetDxDyMoves the mouse
voidtriggerTriggers a mouse button event
booldetectShakeXYFeeds a coordinate into the shake detector.
booldetectShakeDxDyFeeds a coordinate into the shake detector.

getConfig ​

const

cpp
const MouseConfig & getConfig() const

Defined 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 ​

ParameterTypeDescription
xdoubleNew absolute horizontal coordinate
ydoubleNew absolute vertical coordinate

setDxDy ​

cpp
void setDxDy(double dx, double dy)

Defined in VirtualC64.h:952

Moves the mouse

Parameters ​

ParameterTypeDescription
dxdoubleRelative horizontal mouse movement
dydoubleRelative vertical mouse movement

trigger ​

cpp
void trigger(GamePadAction action)

Defined in VirtualC64.h:957

Triggers a mouse button event

Parameters ​

ParameterTypeDescription
actionGamePadActionThe 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 ​

ParameterTypeDescription
xdoubleCurrent horizontal mouse position.
ydoubleCurrent 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 ​

ParameterTypeDescription
dxdoubleCurrent horizontal mouse position, relative to the previous position.
dydoubleCurrent vertical mouse position, relative to the previous position.