Files
godot-docs/classes/class_inputeventmousebutton.rst
2023-06-24 03:22:36 +00:00

150 lines
6.0 KiB
ReStructuredText

:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/InputEventMouseButton.xml.
.. _class_InputEventMouseButton:
InputEventMouseButton
=====================
**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>`
Represents a mouse button being pressed or released.
.. rst-class:: classref-introduction-group
Description
-----------
Stores information about mouse click events. See :ref:`Node._input<class_Node_method__input>`.
.. rst-class:: classref-introduction-group
Tutorials
---------
- :doc:`Using InputEvent <../tutorials/inputs/inputevent>`
- :doc:`Mouse and input coordinates <../tutorials/inputs/mouse_and_input_coordinates>`
.. rst-class:: classref-reftable-group
Properties
----------
.. table::
:widths: auto
+---------------------------------------------------+------------------------------------------------------------------------+-----------+
| :ref:`MouseButton<enum_@GlobalScope_MouseButton>` | :ref:`button_index<class_InputEventMouseButton_property_button_index>` | ``0`` |
+---------------------------------------------------+------------------------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`canceled<class_InputEventMouseButton_property_canceled>` | ``false`` |
+---------------------------------------------------+------------------------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`double_click<class_InputEventMouseButton_property_double_click>` | ``false`` |
+---------------------------------------------------+------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`factor<class_InputEventMouseButton_property_factor>` | ``1.0`` |
+---------------------------------------------------+------------------------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`pressed<class_InputEventMouseButton_property_pressed>` | ``false`` |
+---------------------------------------------------+------------------------------------------------------------------------+-----------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_InputEventMouseButton_property_button_index:
.. rst-class:: classref-property
:ref:`MouseButton<enum_@GlobalScope_MouseButton>` **button_index** = ``0``
.. rst-class:: classref-property-setget
- void **set_button_index** **(** :ref:`MouseButton<enum_@GlobalScope_MouseButton>` value **)**
- :ref:`MouseButton<enum_@GlobalScope_MouseButton>` **get_button_index** **(** **)**
The mouse button identifier, one of the :ref:`MouseButton<enum_@GlobalScope_MouseButton>` button or button wheel constants.
.. rst-class:: classref-item-separator
----
.. _class_InputEventMouseButton_property_canceled:
.. rst-class:: classref-property
:ref:`bool<class_bool>` **canceled** = ``false``
.. rst-class:: classref-property-setget
- void **set_canceled** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_canceled** **(** **)**
If ``true``, the mouse button event has been canceled.
.. rst-class:: classref-item-separator
----
.. _class_InputEventMouseButton_property_double_click:
.. rst-class:: classref-property
:ref:`bool<class_bool>` **double_click** = ``false``
.. rst-class:: classref-property-setget
- void **set_double_click** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_double_click** **(** **)**
If ``true``, the mouse button's state is a double-click.
.. rst-class:: classref-item-separator
----
.. _class_InputEventMouseButton_property_factor:
.. rst-class:: classref-property
:ref:`float<class_float>` **factor** = ``1.0``
.. rst-class:: classref-property-setget
- void **set_factor** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_factor** **(** **)**
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.
.. rst-class:: classref-item-separator
----
.. _class_InputEventMouseButton_property_pressed:
.. 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 mouse button's state is pressed. If ``false``, the mouse button's state is released.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
.. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`