class_inputeventmousebutton.rst 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. :github_url: hide
  2. .. meta::
  3. :keywords: click, press
  4. .. DO NOT EDIT THIS FILE!!!
  5. .. Generated automatically from Godot engine sources.
  6. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  7. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/InputEventMouseButton.xml.
  8. .. _class_InputEventMouseButton:
  9. InputEventMouseButton
  10. =====================
  11. **Inherits:** :ref:`InputEventMouse<class_InputEventMouse>` **<** :ref:`InputEventWithModifiers<class_InputEventWithModifiers>` **<** :ref:`InputEventFromWindow<class_InputEventFromWindow>` **<** :ref:`InputEvent<class_InputEvent>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  12. Represents a mouse button being pressed or released.
  13. .. rst-class:: classref-introduction-group
  14. Description
  15. -----------
  16. Stores information about mouse click events. See :ref:`Node._input<class_Node_private_method__input>`.
  17. \ **Note:** On Wear OS devices, rotary input is mapped to :ref:`@GlobalScope.MOUSE_BUTTON_WHEEL_UP<class_@GlobalScope_constant_MOUSE_BUTTON_WHEEL_UP>` and :ref:`@GlobalScope.MOUSE_BUTTON_WHEEL_DOWN<class_@GlobalScope_constant_MOUSE_BUTTON_WHEEL_DOWN>`. This can be changed to :ref:`@GlobalScope.MOUSE_BUTTON_WHEEL_LEFT<class_@GlobalScope_constant_MOUSE_BUTTON_WHEEL_LEFT>` and :ref:`@GlobalScope.MOUSE_BUTTON_WHEEL_RIGHT<class_@GlobalScope_constant_MOUSE_BUTTON_WHEEL_RIGHT>` with the :ref:`ProjectSettings.input_devices/pointing/android/rotary_input_scroll_axis<class_ProjectSettings_property_input_devices/pointing/android/rotary_input_scroll_axis>` setting.
  18. .. rst-class:: classref-introduction-group
  19. Tutorials
  20. ---------
  21. - :doc:`Using InputEvent <../tutorials/inputs/inputevent>`
  22. - :doc:`Mouse and input coordinates <../tutorials/inputs/mouse_and_input_coordinates>`
  23. .. rst-class:: classref-reftable-group
  24. Properties
  25. ----------
  26. .. table::
  27. :widths: auto
  28. +---------------------------------------------------+------------------------------------------------------------------------+-----------+
  29. | :ref:`MouseButton<enum_@GlobalScope_MouseButton>` | :ref:`button_index<class_InputEventMouseButton_property_button_index>` | ``0`` |
  30. +---------------------------------------------------+------------------------------------------------------------------------+-----------+
  31. | :ref:`bool<class_bool>` | :ref:`canceled<class_InputEventMouseButton_property_canceled>` | ``false`` |
  32. +---------------------------------------------------+------------------------------------------------------------------------+-----------+
  33. | :ref:`bool<class_bool>` | :ref:`double_click<class_InputEventMouseButton_property_double_click>` | ``false`` |
  34. +---------------------------------------------------+------------------------------------------------------------------------+-----------+
  35. | :ref:`float<class_float>` | :ref:`factor<class_InputEventMouseButton_property_factor>` | ``1.0`` |
  36. +---------------------------------------------------+------------------------------------------------------------------------+-----------+
  37. | :ref:`bool<class_bool>` | :ref:`pressed<class_InputEventMouseButton_property_pressed>` | ``false`` |
  38. +---------------------------------------------------+------------------------------------------------------------------------+-----------+
  39. .. rst-class:: classref-section-separator
  40. ----
  41. .. rst-class:: classref-descriptions-group
  42. Property Descriptions
  43. ---------------------
  44. .. _class_InputEventMouseButton_property_button_index:
  45. .. rst-class:: classref-property
  46. :ref:`MouseButton<enum_@GlobalScope_MouseButton>` **button_index** = ``0`` :ref:`🔗<class_InputEventMouseButton_property_button_index>`
  47. .. rst-class:: classref-property-setget
  48. - |void| **set_button_index**\ (\ value\: :ref:`MouseButton<enum_@GlobalScope_MouseButton>`\ )
  49. - :ref:`MouseButton<enum_@GlobalScope_MouseButton>` **get_button_index**\ (\ )
  50. The mouse button identifier, one of the :ref:`MouseButton<enum_@GlobalScope_MouseButton>` button or button wheel constants.
  51. .. rst-class:: classref-item-separator
  52. ----
  53. .. _class_InputEventMouseButton_property_canceled:
  54. .. rst-class:: classref-property
  55. :ref:`bool<class_bool>` **canceled** = ``false`` :ref:`🔗<class_InputEventMouseButton_property_canceled>`
  56. .. rst-class:: classref-property-setget
  57. - |void| **set_canceled**\ (\ value\: :ref:`bool<class_bool>`\ )
  58. - :ref:`bool<class_bool>` **is_canceled**\ (\ )
  59. If ``true``, the mouse button event has been canceled.
  60. .. rst-class:: classref-item-separator
  61. ----
  62. .. _class_InputEventMouseButton_property_double_click:
  63. .. rst-class:: classref-property
  64. :ref:`bool<class_bool>` **double_click** = ``false`` :ref:`🔗<class_InputEventMouseButton_property_double_click>`
  65. .. rst-class:: classref-property-setget
  66. - |void| **set_double_click**\ (\ value\: :ref:`bool<class_bool>`\ )
  67. - :ref:`bool<class_bool>` **is_double_click**\ (\ )
  68. If ``true``, the mouse button's state is a double-click.
  69. .. rst-class:: classref-item-separator
  70. ----
  71. .. _class_InputEventMouseButton_property_factor:
  72. .. rst-class:: classref-property
  73. :ref:`float<class_float>` **factor** = ``1.0`` :ref:`🔗<class_InputEventMouseButton_property_factor>`
  74. .. rst-class:: classref-property-setget
  75. - |void| **set_factor**\ (\ value\: :ref:`float<class_float>`\ )
  76. - :ref:`float<class_float>` **get_factor**\ (\ )
  77. The amount (or delta) of the event. When used for high-precision scroll events, this indicates the scroll amount (vertical or horizontal). This is only supported on some platforms; the reported sensitivity varies depending on the platform. May be ``0`` if not supported.
  78. .. rst-class:: classref-item-separator
  79. ----
  80. .. _class_InputEventMouseButton_property_pressed:
  81. .. rst-class:: classref-property
  82. :ref:`bool<class_bool>` **pressed** = ``false`` :ref:`🔗<class_InputEventMouseButton_property_pressed>`
  83. .. rst-class:: classref-property-setget
  84. - |void| **set_pressed**\ (\ value\: :ref:`bool<class_bool>`\ )
  85. - :ref:`bool<class_bool>` **is_pressed**\ (\ )
  86. If ``true``, the mouse button's state is pressed. If ``false``, the mouse button's state is released.
  87. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  88. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  89. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  90. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  91. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  92. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  93. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  94. .. |void| replace:: :abbr:`void (No return value.)`