mirror of
https://github.com/godotengine/godot-docs.git
synced 2025-12-31 17:49:03 +03:00
156 lines
7.0 KiB
ReStructuredText
156 lines
7.0 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. meta::
|
|
:keywords: click, press
|
|
|
|
.. 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_private_method__input>`.
|
|
|
|
\ **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.
|
|
|
|
.. 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`` :ref:`🔗<class_InputEventMouseButton_property_button_index>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_button_index**\ (\ value\: :ref:`MouseButton<enum_@GlobalScope_MouseButton>`\ )
|
|
- :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`` :ref:`🔗<class_InputEventMouseButton_property_canceled>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_canceled**\ (\ value\: :ref:`bool<class_bool>`\ )
|
|
- :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`` :ref:`🔗<class_InputEventMouseButton_property_double_click>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_double_click**\ (\ value\: :ref:`bool<class_bool>`\ )
|
|
- :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`` :ref:`🔗<class_InputEventMouseButton_property_factor>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_factor**\ (\ value\: :ref:`float<class_float>`\ )
|
|
- :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`` :ref:`🔗<class_InputEventMouseButton_property_pressed>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_pressed**\ (\ value\: :ref:`bool<class_bool>`\ )
|
|
- :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.)`
|
|
.. |void| replace:: :abbr:`void (No return value.)`
|