Key

Keyboard key state checks


Is Just Pressed

is_just_pressed(scancode: Scancode) bool

Check if a key was pressed this frame (by scancode).

Args

  • scancode : The physical key.

Returns

bool : True if the key was newly pressed.


is_just_pressed(keycode: Keycode) bool

Check if a key was pressed this frame (by keycode).

Args

  • keycode : The symbolic key.

Returns

bool : True if the key was newly pressed.

Is Just Released

is_just_released(scancode: Scancode) bool

Check if a key was released this frame (by scancode).

Args

  • scancode : The physical key.

Returns

bool : True if the key was newly released.


is_just_released(keycode: Keycode) bool

Check if a key was released this frame (by keycode).

Args

  • keycode : The symbolic key.

Returns

bool : True if the key was newly released.

Is Pressed

is_pressed(scancode: Scancode) bool

Check if a key is currently held down (by scancode).

Args

  • scancode : The physical key (e.g., S_w).

Returns

bool : True if the key is held.


is_pressed(keycode: Keycode) bool

Check if a key is currently held down (by keycode).

Args

  • keycode : The symbolic key (e.g., K_SPACE).

Returns

bool : True if the key is held.