Input

class Input

One step's input snapshot: every active pointer and the keyboard, handed to the game's step function — sampled state, never events.

Edge flags (Pointer.wasPressed, Pointer.wasReleased, and the Keys pair) are latched across frames and consumed by the first step run for a frame; later steps of the same frame read level state only. Consequences: a click shorter than a frame cannot vanish, and a press during a catch-up burst of steps fires exactly once, never once per step. Edges are booleans — several presses within one frame read as one.

Pointers unify mouse and touch: a mouse is one pointer that persists while up — hover — while a lifted touch contact is dropped once its release edge has been consumed.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val keys: Keys

The keyboard snapshot.

Link copied to clipboard

The first active pointer, or null when there is none — the one a single-pointer game reads.

Link copied to clipboard

The active pointers: a mouse always, touch contacts until their release is consumed.