View Source Exray.Core.Input.Keyboard (Exray v0.1.0)

Summary

Functions

Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty

Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty

Check if a key is being pressed

Check if a key has been pressed once

Check if a key has been pressed again (Only PLATFORM_DESKTOP)

Check if a key has been released once

Check if a key is NOT being pressed

Set a custom key to exit program (default is ESC)

Functions

@spec get_char_pressed() :: {:ok, integer()}

Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty

@spec get_key_pressed() :: {:ok, integer()}

Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty

@spec is_key_down(integer()) :: {:ok, boolean()}

Check if a key is being pressed

@spec is_key_pressed(integer()) :: {:ok, boolean()}

Check if a key has been pressed once

Link to this function

is_key_pressed_repeat(key)

View Source
@spec is_key_pressed_repeat(integer()) :: {:ok, boolean()}

Check if a key has been pressed again (Only PLATFORM_DESKTOP)

@spec is_key_released(integer()) :: {:ok, boolean()}

Check if a key has been released once

@spec is_key_up(integer()) :: {:ok, boolean()}

Check if a key is NOT being pressed

@spec set_exit_key(integer()) :: {:ok}

Set a custom key to exit program (default is ESC)