Module input

Source
Expand description

Cross-platform mouse, keyboard (and gamepads soon) module.

Modules§

utils
Functions for advanced input processing.

Structs§

Touch

Enums§

KeyCode
These keycode values are based off of X11’s keysymdef.h. Missing keycodes from that list are given the prefix 0x01.
MouseButton
TouchPhase

Functions§

clear_input_queue
Clears input queue
get_char_pressed
Return the last pressed char. Each “get_char_pressed” call will consume a character from the input queue.
get_dropped_files
Gets the files which have been dropped on the window.
get_keys_down
get_keys_pressed
get_keys_released
get_last_key_pressed
Return the last pressed key.
is_key_down
Detect if the key is being pressed
is_key_pressed
Detect if the key has been pressed once
is_key_released
Detect if the key has been released this frame
is_mouse_button_down
Detect if the button is being pressed
is_mouse_button_pressed
Detect if the button has been pressed once
is_mouse_button_released
Detect if the button has been released this frame
is_quit_requested
Detect if quit has been requested
is_simulating_mouse_with_touch
This is set to true by default, meaning touches will raise mouse events in addition to raising touch events. If set to false, touches won’t affect mouse events.
mouse_delta_position
Returns the difference between the current mouse position and the mouse position on the previous frame.
mouse_position
Return mouse position in pixels.
mouse_position_local
Return mouse position in range [-1; 1].
mouse_wheel
prevent_quit
Prevents quit
set_cursor_grab
Constrain mouse to window
show_mouse
Set mouse cursor visibility
simulate_mouse_with_touch
This is set to true by default, meaning touches will raise mouse events in addition to raising touch events. If set to false, touches won’t affect mouse events.
touches
Return touches with positions in pixels.
touches_local
Return touches with positions in range [-1; 1].