: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` **<** :ref:`InputEventWithModifiers` **<** :ref:`InputEventFromWindow` **<** :ref:`InputEvent` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`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()`. \ **Note:** On Wear OS devices, rotary input is mapped to :ref:`@GlobalScope.MOUSE_BUTTON_WHEEL_UP` and :ref:`@GlobalScope.MOUSE_BUTTON_WHEEL_DOWN`. This can be changed to :ref:`@GlobalScope.MOUSE_BUTTON_WHEEL_LEFT` and :ref:`@GlobalScope.MOUSE_BUTTON_WHEEL_RIGHT` with the :ref:`ProjectSettings.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` | :ref:`button_index` | ``0`` | +---------------------------------------------------+------------------------------------------------------------------------+-----------+ | :ref:`bool` | :ref:`canceled` | ``false`` | +---------------------------------------------------+------------------------------------------------------------------------+-----------+ | :ref:`bool` | :ref:`double_click` | ``false`` | +---------------------------------------------------+------------------------------------------------------------------------+-----------+ | :ref:`float` | :ref:`factor` | ``1.0`` | +---------------------------------------------------+------------------------------------------------------------------------+-----------+ | :ref:`bool` | :ref:`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` **button_index** = ``0`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_button_index**\ (\ value\: :ref:`MouseButton`\ ) - :ref:`MouseButton` **get_button_index**\ (\ ) The mouse button identifier, one of the :ref:`MouseButton` button or button wheel constants. .. rst-class:: classref-item-separator ---- .. _class_InputEventMouseButton_property_canceled: .. rst-class:: classref-property :ref:`bool` **canceled** = ``false`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_canceled**\ (\ value\: :ref:`bool`\ ) - :ref:`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` **double_click** = ``false`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_double_click**\ (\ value\: :ref:`bool`\ ) - :ref:`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` **factor** = ``1.0`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_factor**\ (\ value\: :ref:`float`\ ) - :ref:`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` **pressed** = ``false`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_pressed**\ (\ value\: :ref:`bool`\ ) - :ref:`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.)` .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)` .. |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.)`