EventPump

Drains SDL's event queue. Owns one native event record, so polling allocates nothing beyond the returned PlatformEvent. close it when the pump is no longer needed, before Sdl.quit.

The pump opens every gamepad SDL announces, because SDL only delivers button and axis events for open gamepads, and closes each one when it is disconnected or the pump is closed. Start Subsystem.GAMEPAD to get gamepad events at all.

Samples live in the sandbox because they need a display.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard

Returns the next event from the queue, or null when the queue is empty.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard

Returns the next event from the queue, waiting up to timeout for one to arrive, or null when none arrives in time. Duration.INFINITE waits until an event arrives.