Keys

class Keys

The keyboard snapshot, over Compose Key codes.

isDown is level state; wasPressed and wasReleased are latched edges — Input carries the latching contract. OS auto-repeat is filtered: holding a key yields one press edge, not a stream.

Functions

Link copied to clipboard
fun isDown(key: Key): Boolean

Returns whether key is held down — level state.

Link copied to clipboard
fun wasPressed(key: Key): Boolean

Returns whether key went down since the last edge-consuming step — a latched edge.

Link copied to clipboard
fun wasReleased(key: Key): Boolean

Returns whether key went up since the last edge-consuming step — a latched edge.