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

Input control for your keyboard

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() :: key_char :: integer()

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

@spec get_key_pressed() :: key_code :: integer()

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

@spec key_is_down?(key :: integer()) :: key_down :: boolean()

Check if a key is being pressed

@spec key_is_pressed?(key :: integer()) :: key_pressed :: boolean()

Check if a key has been pressed once

Link to this function

key_is_pressed_repeat?(key)

View Source
@spec key_is_pressed_repeat?(key :: integer()) :: key_pressed_repeat :: boolean()

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

@spec key_is_released?(key :: integer()) :: key_released :: boolean()

Check if a key has been released once

@spec key_is_up?(key :: integer()) :: key_up :: boolean()

Check if a key is NOT being pressed

@spec set_exit_key(key :: integer()) :: :ok

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