Up to date
This page is up to date for Godot 4.2
.
If you still find outdated information, please open an issue.
Input¶
Inherits: Object
A singleton for handling inputs.
Description¶
The Input singleton handles key presses, mouse buttons and movement, gamepads, and input actions. Actions and their events can be set in the Input Map tab in Project > Project Settings, or with the InputMap class.
Note: Input's methods reflect the global input state and are not affected by Control.accept_event or Viewport.set_input_as_handled, as those methods only deal with the way input is propagated in the SceneTree.
Tutorials¶
Properties¶
Methods¶
Signals¶
joy_connection_changed ( int device, bool connected )
Emitted when a joypad device has been connected or disconnected.
Enumerations¶
enum MouseMode:
MouseMode MOUSE_MODE_VISIBLE = 0
Makes the mouse cursor visible if it is hidden.
Makes the mouse cursor hidden if it is visible.
MouseMode MOUSE_MODE_CAPTURED = 2
Captures the mouse. The mouse will be hidden and its position locked at the center of the window manager's window.
Note: If you want to process the mouse's movement in this mode, you need to use InputEventMouseMotion.relative.
MouseMode MOUSE_MODE_CONFINED = 3
Confines the mouse cursor to the game window, and make it visible.
Confines the mouse cursor to the game window, and make it hidden.