class_inputeventwithmodifiers.rst 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/InputEventWithModifiers.xml.
  6. .. _class_InputEventWithModifiers:
  7. InputEventWithModifiers
  8. =======================
  9. **Inherits:** :ref:`InputEventFromWindow<class_InputEventFromWindow>` **<** :ref:`InputEvent<class_InputEvent>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`InputEventGesture<class_InputEventGesture>`, :ref:`InputEventKey<class_InputEventKey>`, :ref:`InputEventMouse<class_InputEventMouse>`
  11. Abstract base class for input events affected by modifier keys like :kbd:`Shift` and :kbd:`Alt`.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. 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<class_Node_private_method__input>`.
  16. \ **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<class_InputEventWithModifiers_property_ctrl_pressed>`, will return ``false`` if the key is pressed on its own.
  17. .. rst-class:: classref-introduction-group
  18. Tutorials
  19. ---------
  20. - :doc:`Using InputEvent <../tutorials/inputs/inputevent>`
  21. .. rst-class:: classref-reftable-group
  22. Properties
  23. ----------
  24. .. table::
  25. :widths: auto
  26. +-------------------------+----------------------------------------------------------------------------------------------------------+-----------+
  27. | :ref:`bool<class_bool>` | :ref:`alt_pressed<class_InputEventWithModifiers_property_alt_pressed>` | ``false`` |
  28. +-------------------------+----------------------------------------------------------------------------------------------------------+-----------+
  29. | :ref:`bool<class_bool>` | :ref:`command_or_control_autoremap<class_InputEventWithModifiers_property_command_or_control_autoremap>` | ``false`` |
  30. +-------------------------+----------------------------------------------------------------------------------------------------------+-----------+
  31. | :ref:`bool<class_bool>` | :ref:`ctrl_pressed<class_InputEventWithModifiers_property_ctrl_pressed>` | ``false`` |
  32. +-------------------------+----------------------------------------------------------------------------------------------------------+-----------+
  33. | :ref:`bool<class_bool>` | :ref:`meta_pressed<class_InputEventWithModifiers_property_meta_pressed>` | ``false`` |
  34. +-------------------------+----------------------------------------------------------------------------------------------------------+-----------+
  35. | :ref:`bool<class_bool>` | :ref:`shift_pressed<class_InputEventWithModifiers_property_shift_pressed>` | ``false`` |
  36. +-------------------------+----------------------------------------------------------------------------------------------------------+-----------+
  37. .. rst-class:: classref-reftable-group
  38. Methods
  39. -------
  40. .. table::
  41. :widths: auto
  42. +-------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
  43. | |bitfield|\[:ref:`KeyModifierMask<enum_@GlobalScope_KeyModifierMask>`\] | :ref:`get_modifiers_mask<class_InputEventWithModifiers_method_get_modifiers_mask>`\ (\ ) |const| |
  44. +-------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
  45. | :ref:`bool<class_bool>` | :ref:`is_command_or_control_pressed<class_InputEventWithModifiers_method_is_command_or_control_pressed>`\ (\ ) |const| |
  46. +-------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
  47. .. rst-class:: classref-section-separator
  48. ----
  49. .. rst-class:: classref-descriptions-group
  50. Property Descriptions
  51. ---------------------
  52. .. _class_InputEventWithModifiers_property_alt_pressed:
  53. .. rst-class:: classref-property
  54. :ref:`bool<class_bool>` **alt_pressed** = ``false`` :ref:`🔗<class_InputEventWithModifiers_property_alt_pressed>`
  55. .. rst-class:: classref-property-setget
  56. - |void| **set_alt_pressed**\ (\ value\: :ref:`bool<class_bool>`\ )
  57. - :ref:`bool<class_bool>` **is_alt_pressed**\ (\ )
  58. State of the :kbd:`Alt` modifier.
  59. .. rst-class:: classref-item-separator
  60. ----
  61. .. _class_InputEventWithModifiers_property_command_or_control_autoremap:
  62. .. rst-class:: classref-property
  63. :ref:`bool<class_bool>` **command_or_control_autoremap** = ``false`` :ref:`🔗<class_InputEventWithModifiers_property_command_or_control_autoremap>`
  64. .. rst-class:: classref-property-setget
  65. - |void| **set_command_or_control_autoremap**\ (\ value\: :ref:`bool<class_bool>`\ )
  66. - :ref:`bool<class_bool>` **is_command_or_control_autoremap**\ (\ )
  67. Automatically use :kbd:`Meta` (:kbd:`Cmd`) on macOS and :kbd:`Ctrl` on other platforms. If ``true``, :ref:`ctrl_pressed<class_InputEventWithModifiers_property_ctrl_pressed>` and :ref:`meta_pressed<class_InputEventWithModifiers_property_meta_pressed>` cannot be set.
  68. .. rst-class:: classref-item-separator
  69. ----
  70. .. _class_InputEventWithModifiers_property_ctrl_pressed:
  71. .. rst-class:: classref-property
  72. :ref:`bool<class_bool>` **ctrl_pressed** = ``false`` :ref:`🔗<class_InputEventWithModifiers_property_ctrl_pressed>`
  73. .. rst-class:: classref-property-setget
  74. - |void| **set_ctrl_pressed**\ (\ value\: :ref:`bool<class_bool>`\ )
  75. - :ref:`bool<class_bool>` **is_ctrl_pressed**\ (\ )
  76. State of the :kbd:`Ctrl` modifier.
  77. .. rst-class:: classref-item-separator
  78. ----
  79. .. _class_InputEventWithModifiers_property_meta_pressed:
  80. .. rst-class:: classref-property
  81. :ref:`bool<class_bool>` **meta_pressed** = ``false`` :ref:`🔗<class_InputEventWithModifiers_property_meta_pressed>`
  82. .. rst-class:: classref-property-setget
  83. - |void| **set_meta_pressed**\ (\ value\: :ref:`bool<class_bool>`\ )
  84. - :ref:`bool<class_bool>` **is_meta_pressed**\ (\ )
  85. 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.
  86. .. rst-class:: classref-item-separator
  87. ----
  88. .. _class_InputEventWithModifiers_property_shift_pressed:
  89. .. rst-class:: classref-property
  90. :ref:`bool<class_bool>` **shift_pressed** = ``false`` :ref:`🔗<class_InputEventWithModifiers_property_shift_pressed>`
  91. .. rst-class:: classref-property-setget
  92. - |void| **set_shift_pressed**\ (\ value\: :ref:`bool<class_bool>`\ )
  93. - :ref:`bool<class_bool>` **is_shift_pressed**\ (\ )
  94. State of the :kbd:`Shift` modifier.
  95. .. rst-class:: classref-section-separator
  96. ----
  97. .. rst-class:: classref-descriptions-group
  98. Method Descriptions
  99. -------------------
  100. .. _class_InputEventWithModifiers_method_get_modifiers_mask:
  101. .. rst-class:: classref-method
  102. |bitfield|\[:ref:`KeyModifierMask<enum_@GlobalScope_KeyModifierMask>`\] **get_modifiers_mask**\ (\ ) |const| :ref:`🔗<class_InputEventWithModifiers_method_get_modifiers_mask>`
  103. Returns the keycode combination of modifier keys.
  104. .. rst-class:: classref-item-separator
  105. ----
  106. .. _class_InputEventWithModifiers_method_is_command_or_control_pressed:
  107. .. rst-class:: classref-method
  108. :ref:`bool<class_bool>` **is_command_or_control_pressed**\ (\ ) |const| :ref:`🔗<class_InputEventWithModifiers_method_is_command_or_control_pressed>`
  109. On macOS, returns ``true`` if :kbd:`Meta` (:kbd:`Cmd`) is pressed.
  110. On other platforms, returns ``true`` if :kbd:`Ctrl` is pressed.
  111. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  112. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  113. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  114. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  115. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  116. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  117. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  118. .. |void| replace:: :abbr:`void (No return value.)`