ZKeyboardState

Maintains the current state of pressed keyboard keys.

This class tracks which keys are currently pressed, similar to Unity's Input.GetKey(), Unreal's IsInputKeyDown(), or Godot's Input.is_action_pressed().

The state is automatically updated by the event system when keyboard events are processed during the game loop frame update phase. You should not manually update the state; instead, use isKeyPressed to query the current state of keys.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

Returns whether any keys are currently pressed.

Link copied to clipboard

Returns the number of keys currently pressed.

Functions

Link copied to clipboard
fun clear()

Clears all pressed keys from the state. This can be useful for resetting the state, for example when the window loses focus or during scene transitions.

Link copied to clipboard

Checks if the specified key is currently pressed.