: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/InputEventWithModifiers.xml. .. _class_InputEventWithModifiers: InputEventWithModifiers ======================= **Inherits:** :ref:`InputEventFromWindow` **<** :ref:`InputEvent` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` **Inherited By:** :ref:`InputEventGesture`, :ref:`InputEventKey`, :ref:`InputEventMouse` Abstract base class for input events affected by modifier keys like :kbd:`Shift` and :kbd:`Alt`. .. rst-class:: classref-introduction-group Description ----------- Stores information about mouse, keyboard, and touch gesture input events. This includes information about which modifier keys are pressed, such as :kbd:`Shift` or :kbd:`Alt`. See :ref:`Node._input()`. \ **Note:** Modifier keys are considered modifiers only when used in combination with another key. As a result, their corresponding member variables, such as :ref:`ctrl_pressed`, will return ``false`` if the key is pressed on its own. .. rst-class:: classref-introduction-group Tutorials --------- - :doc:`Using InputEvent <../tutorials/inputs/inputevent>` .. rst-class:: classref-reftable-group Properties ---------- .. table:: :widths: auto +-------------------------+----------------------------------------------------------------------------------------------------------+-----------+ | :ref:`bool` | :ref:`alt_pressed` | ``false`` | +-------------------------+----------------------------------------------------------------------------------------------------------+-----------+ | :ref:`bool` | :ref:`command_or_control_autoremap` | ``false`` | +-------------------------+----------------------------------------------------------------------------------------------------------+-----------+ | :ref:`bool` | :ref:`ctrl_pressed` | ``false`` | +-------------------------+----------------------------------------------------------------------------------------------------------+-----------+ | :ref:`bool` | :ref:`meta_pressed` | ``false`` | +-------------------------+----------------------------------------------------------------------------------------------------------+-----------+ | :ref:`bool` | :ref:`shift_pressed` | ``false`` | +-------------------------+----------------------------------------------------------------------------------------------------------+-----------+ .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +-------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | |bitfield|\[:ref:`KeyModifierMask`\] | :ref:`get_modifiers_mask`\ (\ ) |const| | +-------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_command_or_control_pressed`\ (\ ) |const| | +-------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Property Descriptions --------------------- .. _class_InputEventWithModifiers_property_alt_pressed: .. rst-class:: classref-property :ref:`bool` **alt_pressed** = ``false`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_alt_pressed**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_alt_pressed**\ (\ ) State of the :kbd:`Alt` modifier. .. rst-class:: classref-item-separator ---- .. _class_InputEventWithModifiers_property_command_or_control_autoremap: .. rst-class:: classref-property :ref:`bool` **command_or_control_autoremap** = ``false`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_command_or_control_autoremap**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_command_or_control_autoremap**\ (\ ) Automatically use :kbd:`Meta` (:kbd:`Cmd`) on macOS and :kbd:`Ctrl` on other platforms. If ``true``, :ref:`ctrl_pressed` and :ref:`meta_pressed` cannot be set. .. rst-class:: classref-item-separator ---- .. _class_InputEventWithModifiers_property_ctrl_pressed: .. rst-class:: classref-property :ref:`bool` **ctrl_pressed** = ``false`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_ctrl_pressed**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_ctrl_pressed**\ (\ ) State of the :kbd:`Ctrl` modifier. .. rst-class:: classref-item-separator ---- .. _class_InputEventWithModifiers_property_meta_pressed: .. rst-class:: classref-property :ref:`bool` **meta_pressed** = ``false`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_meta_pressed**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_meta_pressed**\ (\ ) State of the :kbd:`Meta` modifier. On Windows and Linux, this represents the Windows key (sometimes called "meta" or "super" on Linux). On macOS, this represents the Command key. .. rst-class:: classref-item-separator ---- .. _class_InputEventWithModifiers_property_shift_pressed: .. rst-class:: classref-property :ref:`bool` **shift_pressed** = ``false`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_shift_pressed**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_shift_pressed**\ (\ ) State of the :kbd:`Shift` modifier. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_InputEventWithModifiers_method_get_modifiers_mask: .. rst-class:: classref-method |bitfield|\[:ref:`KeyModifierMask`\] **get_modifiers_mask**\ (\ ) |const| :ref:`🔗` Returns the keycode combination of modifier keys. .. rst-class:: classref-item-separator ---- .. _class_InputEventWithModifiers_method_is_command_or_control_pressed: .. rst-class:: classref-method :ref:`bool` **is_command_or_control_pressed**\ (\ ) |const| :ref:`🔗` On macOS, returns ``true`` if :kbd:`Meta` (:kbd:`Cmd`) is pressed. On other platforms, returns ``true`` if :kbd:`Ctrl` is pressed. .. |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.)`