class

RenderLoop::Input(Key, MouseButton)

Inherits Reference / Object

Provides a helpful wrapper over window input.

Constructors

new(window : RenderLoop::Window(Key, MouseButton))
Source

Instance methods

get_center

Returns the center of the window

Source
get_key(key_code : Key) : Bool

Checks if the key is currently down

Source
get_key_pressed(key_code : Key) : Bool

Checks if the key was pressed in this frame

Source
get_key_released(key_code : Key) : Bool

Checks if the key was released in this frame

Source
get_keys

Returns an array of keys that are currently pressed

Source
get_mouse(mouse_button : MouseButton) : Bool

Check if the mouse button is currently down

Source
get_mouse_position

Returns the position of the mouse

Source
get_mouse_pressed(mouse_button : MouseButton) : Bool

Checks if the mouse button was pressed in this frame

Source
get_mouse_released(mouse_button : MouseButton) : Bool

Checks if the mouse button was released in this frame

Source
set_cursor(enabled : Bool)

Controls the cursor visibility within the window

Source
set_mouse_position(position : RenderLoop::Position)

Sets the mouse position within the window

Source
tick

Processes the window input during each update tick

Source
window_size

Returns the size of the window

Source