Skip to content

KeyboardState

1 min read

Import: import system.window;

Read the usage guide for examples and common tasks. This reference lists the public declarations for this part of the library. See Reading API signatures for parameter and result notation.

KeyboardState

The keyboard as of one Window.poll. is_down is the current level of a key. pressed and released are edges: they are true only in the frame where the key changed, and a key pressed and released between two polls reports both edges in the same frame while is_down is false. Key repeats never count as presses.

public class KeyboardState

is_down

True while code is held down.

public fun is_down(code: KeyCode): bool

pressed

True when code went down during this frame.

public fun pressed(code: KeyCode): bool

released

True when code was released during this frame.

public fun released(code: KeyCode): bool