Up to date
This page is up to date for Godot 4.1.
If you still find outdated information, please open an issue.
Inherits: InputEvent < Resource < RefCounted < Object
Represents a gamepad button being pressed or released.
Input event type for gamepad buttons. For gamepad analog sticks and joysticks, see InputEventJoypadMotion.
JoyButton button_index = 0
void set_button_index ( JoyButton value )
JoyButton get_button_index ( )
Button identifier. One of the JoyButton button constants.
bool pressed = false
void set_pressed ( bool value )
bool is_pressed ( )
If true, the button's state is pressed. If false, the button's state is released.
float pressure = 0.0
void set_pressure ( float value )
float get_pressure ( )
Represents the pressure the user puts on the button with their finger, if the controller supports it. Ranges from 0 to 1.