Skip to main content

Input

Inherits: Object

Description

A singleton for handling inputs. The Input singleton handles key presses, mouse buttons and movement, gamepads, and input actions.

Properties

MouseMode
Controls the mouse mode (visible, hidden, captured, confined).

Methods

is_action_pressed

Returns true if you are pressing the action event.
StringName
The action name to check

is_action_just_pressed

Returns true when the user has started pressing the action event in the current frame.

is_key_pressed

Returns true if you are pressing the Latin key in the current keyboard layout.

get_vector

Gets an input vector by specifying four actions for the positive and negative X and Y axes.

get_axis

Get axis input by specifying two actions, one negative and one positive.

is_mouse_button_pressed

Returns true if you are pressing the mouse button.

Example Usage