natiny_input_get_key_down

C
bool natiny_input_get_key_down(uint32_t key);

Returns true if the specified keyboard key is currently held down.

Parameters

Name Type Description
key uint32_t Key code - a NATINY_INPUT_KEY_* constant

Returns

Type Description
bool true if the key is held, false otherwise

Example

C
if (natiny_input_get_key_down(NATINY_INPUT_KEY_W))
    move_forward();

Notes

  • Returns true every frame while the key remains held.
  • Key constants are listed in Key codes.