key
pykraken.key Keyboard key state checks
At a glance
3 membersReference
PYTHON APIOverloaded function.
is_just_pressed(scancode: Scancode) -> bool
Check if a key was pressed this frame (by scancode).
Args
- scancode (
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 (
Keycode) — The symbolic key.
Returns
- bool — True if the key was newly pressed.
Overloaded function.
is_just_released(scancode: Scancode) -> bool
Check if a key was released this frame (by scancode).
Args
- scancode (
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 (
Keycode) — The symbolic key.
Returns
- bool — True if the key was newly released.
Overloaded function.
is_pressed(scancode: Scancode) -> bool
Check if a key is currently held down (by scancode).
Args
- scancode (
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 (
Keycode) — The symbolic key (e.g., K_SPACE).
Returns
- bool — True if the key is held.