InputHandler

An input handler, which keeps track of what inputs are being held, pressed, released, etc. Has to be registered to an event handler

Constructors

this
this(Handler h)

Constructs an input handler from an SDL handler, which it attaches delegates to.

Members

Functions

getHeldFor
int getHeldFor(Keysym key)

Gets how long a key has been held for if it hasn't been released

isKeyDown
bool isKeyDown(SDL_Keycode s)

Whether the key is down, ignoring modifiers. Checks isKeyHeld and wasKeyPressed, in that order

isKeyHeld
bool isKeyHeld(SDL_Keycode s)

Whether the key is held, ignoring modifiers

wasKeyPressed
bool wasKeyPressed(SDL_Keycode s)

Whether the key was pressed, ignoring modifiers

wasKeyReleased
bool wasKeyReleased(SDL_Keycode s)

Whether the key was released, ignoring modifiers

wasMousePressed
bool wasMousePressed(ubyte u)

Whether the mouse button was pressed

wasMouseReleased
bool wasMouseReleased(ubyte u)

Whether the mouse button was released

Properties

heldKeys
heldKeys [@property getter]

The keys that are being held; use getHeldFor to get time held

mouseMotionEvents
mouseMotionEvents [@property getter]

The mouse movements that happend this frame

mouseWheelEvents
mouseWheelEvents [@property getter]

The mouse scrolling that happened this frame

pressedKeys
pressedKeys [@property getter]

The keys pressed this frame

pressedMouseButtons
pressedMouseButtons [@property getter]

The mouse buttons that were pressed this frame

releasedKeys
releasedKeys [@property getter]

The keys that were released this frame

releasedMouseButtons
releasedMouseButtons [@property getter]

The mouse buttons that were released this frame

Meta