class_inputeventjoypadbutton.rst 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/4.0/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.0/doc/classes/InputEventJoypadButton.xml.
  6. .. _class_InputEventJoypadButton:
  7. InputEventJoypadButton
  8. ======================
  9. **Inherits:** :ref:`InputEvent<class_InputEvent>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Represents a gamepad button being pressed or released.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. Input event type for gamepad buttons. For gamepad analog sticks and joysticks, see :ref:`InputEventJoypadMotion<class_InputEventJoypadMotion>`.
  15. .. rst-class:: classref-introduction-group
  16. Tutorials
  17. ---------
  18. - :doc:`Using InputEvent <../tutorials/inputs/inputevent>`
  19. .. rst-class:: classref-reftable-group
  20. Properties
  21. ----------
  22. .. table::
  23. :widths: auto
  24. +-----------------------------------------------+-------------------------------------------------------------------------+-----------+
  25. | :ref:`JoyButton<enum_@GlobalScope_JoyButton>` | :ref:`button_index<class_InputEventJoypadButton_property_button_index>` | ``0`` |
  26. +-----------------------------------------------+-------------------------------------------------------------------------+-----------+
  27. | :ref:`bool<class_bool>` | :ref:`pressed<class_InputEventJoypadButton_property_pressed>` | ``false`` |
  28. +-----------------------------------------------+-------------------------------------------------------------------------+-----------+
  29. | :ref:`float<class_float>` | :ref:`pressure<class_InputEventJoypadButton_property_pressure>` | ``0.0`` |
  30. +-----------------------------------------------+-------------------------------------------------------------------------+-----------+
  31. .. rst-class:: classref-section-separator
  32. ----
  33. .. rst-class:: classref-descriptions-group
  34. Property Descriptions
  35. ---------------------
  36. .. _class_InputEventJoypadButton_property_button_index:
  37. .. rst-class:: classref-property
  38. :ref:`JoyButton<enum_@GlobalScope_JoyButton>` **button_index** = ``0``
  39. .. rst-class:: classref-property-setget
  40. - void **set_button_index** **(** :ref:`JoyButton<enum_@GlobalScope_JoyButton>` value **)**
  41. - :ref:`JoyButton<enum_@GlobalScope_JoyButton>` **get_button_index** **(** **)**
  42. Button identifier. One of the :ref:`JoyButton<enum_@GlobalScope_JoyButton>` button constants.
  43. .. rst-class:: classref-item-separator
  44. ----
  45. .. _class_InputEventJoypadButton_property_pressed:
  46. .. rst-class:: classref-property
  47. :ref:`bool<class_bool>` **pressed** = ``false``
  48. .. rst-class:: classref-property-setget
  49. - void **set_pressed** **(** :ref:`bool<class_bool>` value **)**
  50. - :ref:`bool<class_bool>` **is_pressed** **(** **)**
  51. If ``true``, the button's state is pressed. If ``false``, the button's state is released.
  52. .. rst-class:: classref-item-separator
  53. ----
  54. .. _class_InputEventJoypadButton_property_pressure:
  55. .. rst-class:: classref-property
  56. :ref:`float<class_float>` **pressure** = ``0.0``
  57. .. rst-class:: classref-property-setget
  58. - void **set_pressure** **(** :ref:`float<class_float>` value **)**
  59. - :ref:`float<class_float>` **get_pressure** **(** **)**
  60. Represents the pressure the user puts on the button with their finger, if the controller supports it. Ranges from ``0`` to ``1``.
  61. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  62. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  63. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  64. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  65. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  66. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`