github_url: | hide |
---|
Inherits: :ref:`InputEvent<class_InputEvent>` < :ref:`Resource<class_Resource>` < :ref:`RefCounted<class_RefCounted>` < :ref:`Object<class_Object>`
Represents a gamepad button being pressed or released.
.. rst-class:: classref-introduction-group
Input event type for gamepad buttons. For gamepad analog sticks and joysticks, see :ref:`InputEventJoypadMotion<class_InputEventJoypadMotion>`.
.. rst-class:: classref-introduction-group
.. rst-class:: classref-reftable-group
.. rst-class:: classref-section-separator
.. rst-class:: classref-descriptions-group
.. rst-class:: classref-property
:ref:`JoyButton<enum_@GlobalScope_JoyButton>` button_index = 0
.. rst-class:: classref-property-setget
- void set_button_index ( :ref:`JoyButton<enum_@GlobalScope_JoyButton>` value )
- :ref:`JoyButton<enum_@GlobalScope_JoyButton>` get_button_index ( )
Button identifier. One of the :ref:`JoyButton<enum_@GlobalScope_JoyButton>` button constants.
.. rst-class:: classref-item-separator
.. rst-class:: classref-property
:ref:`bool<class_bool>` pressed = false
.. rst-class:: classref-property-setget
- void set_pressed ( :ref:`bool<class_bool>` value )
- :ref:`bool<class_bool>` is_pressed ( )
If true
, the button's state is pressed. If false
, the button's state is released.
.. rst-class:: classref-item-separator
.. rst-class:: classref-property
:ref:`float<class_float>` pressure = 0.0
.. rst-class:: classref-property-setget
- void set_pressure ( :ref:`float<class_float>` value )
- :ref:`float<class_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
.