InputHandler

Input handler. Handle mouse movements and mouse buttons / keys states.

Constructors

this
this()

InputHandler constructor.

Destructor

~this
~this()

InputHandler destructor.

Members

Functions

isKeyPressed
bool isKeyPressed(Key key)

Checks if a specific key is pressed.

isMouseButtonClicked
bool isMouseButtonClicked(MouseButton button)

Checks if a specific mouse button is clicked.

onMouseButton
void onMouseButton(MouseButton button, bool pressed)

Event called on mouse button action.

onMouseMove
void onMouseMove(vec2 position)

Event called on mouse movement.

update
void update()

Updates input states and triggers events.

Properties

mousePosition
const(vec2) mousePosition [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.

Meta