Mouse

Keeps track of mouse position, buttons, dragging, etc.

Constructors

this
this(long delegate() @safe pure nothrow @nogc getHeight)

Construct a Mouse and initialize button states.

Alias This

baseState_

Members

Enums

Button
enum Button

Enumerates mouse buttons.

Functions

button
Flag!"pressed" button(Button button)

Get the state of specified mouse button.

clicked
Flag!"click" clicked(Button button)

Did the user finish a click during this update?

doubleClicked
Flag!"doubleClick" doubleClicked(Button button)

Did the user finish a double click during this update?

pressedCoords
vec2i pressedCoords(Button button)

Get the coordinates at which button was last pressed. Useful for dragging.

wheelX
int wheelX()

Get X coordinate of the mouse wheel (if it supports horizontal scrolling).

wheelXMovement
int wheelXMovement()

Get the X movement of the wheel since the last update.

wheelY
int wheelY()

Get Y coordinate of the mouse wheel.

wheelYMovement
int wheelYMovement()

Get the Y movement of the wheel since the last update.

x
int x()

Get X coordinate of mouse position.

xMovement
int xMovement()

Get X movement of mouse since the last update.

y
int y()

Get Y coordinate of mouse position.

yMovement
int yMovement()

Get Y movement of mouse since the last update.

Meta