620 lines
35 KiB
ReStructuredText
620 lines
35 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. DO NOT EDIT THIS FILE!!!
|
|
.. Generated automatically from GUT Plugin sources.
|
|
.. Generator: documentation/godot_make_rst.py.
|
|
.. _class_GutInputSender:
|
|
|
|
GutInputSender
|
|
==============
|
|
|
|
**Inherits:** `RefCounted <https://docs.godotengine.org/en/stable/classes/class_refcounted.html>`_
|
|
|
|
The GutInputSender class. It sends input to places.
|
|
|
|
.. rst-class:: classref-introduction-group
|
|
|
|
Description
|
|
-----------
|
|
|
|
|
|
|
|
|
|
|
|
GUT Wiki: `https://gut.readthedocs.io <https://gut.readthedocs.io>`__\
|
|
|
|
See `Mocking-Input <../Mocking-Input.html>`__ for examples.
|
|
|
|
|
|
|
|
This class can be used to send ``InputEvent*`` events to various objects. It also allows you to script out a series of inputs and play them back in real time. You could use it to:
|
|
|
|
- Verify that jump height depends on how long the jump button is pressed.
|
|
|
|
- Double tap a direction performs a dash.
|
|
|
|
- Down, Down-Forward, Forward + punch throws a fireball.
|
|
|
|
|
|
|
|
|
|
|
|
And much much more.
|
|
|
|
|
|
|
|
As of 9.3.1 you can use ``GutInputSender`` instead of ``InputSender``. It's the same thing, but ``GutInputSender`` is a ``class_name`` so you may have less warnings and auto-complete will work.
|
|
|
|
|
|
|
|
\ **Warning**\
|
|
|
|
If you move the Godot window to a different monitor while tests are running it can cause input tests to fail. `This issue <https://github.com/bitwes/Gut/issues/643>`__ has more details.
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
Properties
|
|
----------
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+--------------------------------------------------------------------------------+-------------------------------------------------------------+-----------+
|
|
| `Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ | :ref:`mouse_warp<class_GutInputSender_property_mouse_warp>` | ``false`` |
|
|
+--------------------------------------------------------------------------------+-------------------------------------------------------------+-----------+
|
|
| `Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ | :ref:`draw_mouse<class_GutInputSender_property_draw_mouse>` | ``true`` |
|
|
+--------------------------------------------------------------------------------+-------------------------------------------------------------+-----------+
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
Methods
|
|
-------
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`_init<class_GutInputSender_private_method__init>`\ (\ r = null\ ) |
|
|
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| `Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ | :ref:`action_down<class_GutInputSender_method_action_down>`\ (\ which, strength = 1.0\ ) |
|
|
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| `Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ | :ref:`action_up<class_GutInputSender_method_action_up>`\ (\ which, strength = 1.0\ ) |
|
|
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`add_receiver<class_GutInputSender_method_add_receiver>`\ (\ obj\ ) |
|
|
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`clear<class_GutInputSender_method_clear>`\ (\ ) |
|
|
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| `Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ | :ref:`get_auto_flush_input<class_GutInputSender_method_get_auto_flush_input>`\ (\ ) |
|
|
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| `Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ | :ref:`get_receivers<class_GutInputSender_method_get_receivers>`\ (\ ) |
|
|
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| `Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ | :ref:`hold_for<class_GutInputSender_method_hold_for>`\ (\ duration\ ) |
|
|
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| `Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ | :ref:`hold_frames<class_GutInputSender_method_hold_frames>`\ (\ duration\: `int <https://docs.godotengine.org/en/stable/classes/class_int.html>`_\ ) |
|
|
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| `Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ | :ref:`hold_seconds<class_GutInputSender_method_hold_seconds>`\ (\ duration\: `float <https://docs.godotengine.org/en/stable/classes/class_float.html>`_\ ) |
|
|
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| `Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ | :ref:`is_action_pressed<class_GutInputSender_method_is_action_pressed>`\ (\ which\ ) |
|
|
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| `Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ | :ref:`is_idle<class_GutInputSender_method_is_idle>`\ (\ ) |
|
|
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| `Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ | :ref:`is_key_pressed<class_GutInputSender_method_is_key_pressed>`\ (\ which\ ) |
|
|
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| `Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ | :ref:`is_mouse_button_pressed<class_GutInputSender_method_is_mouse_button_pressed>`\ (\ which\ ) |
|
|
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| `Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ | :ref:`key_down<class_GutInputSender_method_key_down>`\ (\ which\ ) |
|
|
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| `Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ | :ref:`key_echo<class_GutInputSender_method_key_echo>`\ (\ ) |
|
|
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| `Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ | :ref:`key_up<class_GutInputSender_method_key_up>`\ (\ which\ ) |
|
|
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| `Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ | :ref:`mouse_double_click<class_GutInputSender_method_mouse_double_click>`\ (\ position = null, global_position = null\ ) |
|
|
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| `Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ | :ref:`mouse_left_button_down<class_GutInputSender_method_mouse_left_button_down>`\ (\ position = null, global_position = null\ ) |
|
|
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| `Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ | :ref:`mouse_left_button_up<class_GutInputSender_method_mouse_left_button_up>`\ (\ position = null, global_position = null\ ) |
|
|
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| `Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ | :ref:`mouse_left_click_at<class_GutInputSender_method_mouse_left_click_at>`\ (\ where, duration = "5f"\ ) |
|
|
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| `Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ | :ref:`mouse_motion<class_GutInputSender_method_mouse_motion>`\ (\ position, global_position = null\ ) |
|
|
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| `Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ | :ref:`mouse_relative_motion<class_GutInputSender_method_mouse_relative_motion>`\ (\ offset, speed = Vector2(0, 0)\ ) |
|
|
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| `Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ | :ref:`mouse_right_button_down<class_GutInputSender_method_mouse_right_button_down>`\ (\ position = null, global_position = null\ ) |
|
|
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| `Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ | :ref:`mouse_right_button_up<class_GutInputSender_method_mouse_right_button_up>`\ (\ position = null, global_position = null\ ) |
|
|
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| `Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ | :ref:`mouse_set_position<class_GutInputSender_method_mouse_set_position>`\ (\ position, global_position = null\ ) |
|
|
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| `Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ | :ref:`release_all<class_GutInputSender_method_release_all>`\ (\ ) |
|
|
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| `Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ | :ref:`send_event<class_GutInputSender_method_send_event>`\ (\ event\ ) |
|
|
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`set_auto_flush_input<class_GutInputSender_method_set_auto_flush_input>`\ (\ val\ ) |
|
|
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| `Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ | :ref:`wait<class_GutInputSender_method_wait>`\ (\ t\ ) |
|
|
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| `Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ | :ref:`wait_frames<class_GutInputSender_method_wait_frames>`\ (\ num_frames\ ) |
|
|
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| `Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ | :ref:`wait_secs<class_GutInputSender_method_wait_secs>`\ (\ num_secs\ ) |
|
|
+--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Signals
|
|
-------
|
|
|
|
.. _class_GutInputSender_signal_idle:
|
|
|
|
.. rst-class:: classref-signal
|
|
|
|
**idle**\ (\ ) :ref:`🔗<class_GutInputSender_signal_idle>`
|
|
|
|
Emitted when all events in the input queue have been sent.
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Constants
|
|
---------
|
|
|
|
.. _class_GutInputSender_constant_INPUT_WARN:
|
|
|
|
.. rst-class:: classref-constant
|
|
|
|
**INPUT_WARN** = ``"If using Input as a reciever it will not respond to *_down events until a *_up event is recieved. Call the appropriate *_up event or use hold_for(...) to automatically release after some duration."`` :ref:`🔗<class_GutInputSender_constant_INPUT_WARN>`
|
|
|
|
Local reference to the GutInputFactory static class
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Property Descriptions
|
|
---------------------
|
|
|
|
.. _class_GutInputSender_property_mouse_warp:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
`Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ **mouse_warp** = ``false`` :ref:`🔗<class_GutInputSender_property_mouse_warp>`
|
|
|
|
Warp mouse when sending InputEventMouse\* events
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GutInputSender_property_draw_mouse:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
`Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ **draw_mouse** = ``true`` :ref:`🔗<class_GutInputSender_property_draw_mouse>`
|
|
|
|
Draw mouse position cross hairs. Useful to see where the mouse is at when not using :ref:`mouse_warp<class_GutInputSender_property_mouse_warp>`
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Method Descriptions
|
|
-------------------
|
|
|
|
.. _class_GutInputSender_private_method__init:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **_init**\ (\ r = null\ ) :ref:`🔗<class_GutInputSender_private_method__init>`
|
|
|
|
Accepts a single optional receiver.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GutInputSender_method_add_receiver:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **add_receiver**\ (\ obj\ ) :ref:`🔗<class_GutInputSender_method_add_receiver>`
|
|
|
|
Add an object to receive input events.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GutInputSender_method_get_receivers:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
`Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ **get_receivers**\ (\ ) :ref:`🔗<class_GutInputSender_method_get_receivers>`
|
|
|
|
Returns the receivers that have been added.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GutInputSender_method_is_idle:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
`Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ **is_idle**\ (\ ) :ref:`🔗<class_GutInputSender_method_is_idle>`
|
|
|
|
Returns true if the input queue has items to be processed, false if not.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GutInputSender_method_is_key_pressed:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
`Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ **is_key_pressed**\ (\ which\ ) :ref:`🔗<class_GutInputSender_method_is_key_pressed>`
|
|
|
|
.. container:: contribute
|
|
|
|
No description
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GutInputSender_method_is_action_pressed:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
`Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ **is_action_pressed**\ (\ which\ ) :ref:`🔗<class_GutInputSender_method_is_action_pressed>`
|
|
|
|
.. container:: contribute
|
|
|
|
No description
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GutInputSender_method_is_mouse_button_pressed:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
`Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ **is_mouse_button_pressed**\ (\ which\ ) :ref:`🔗<class_GutInputSender_method_is_mouse_button_pressed>`
|
|
|
|
.. container:: contribute
|
|
|
|
No description
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GutInputSender_method_get_auto_flush_input:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
`Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ **get_auto_flush_input**\ (\ ) :ref:`🔗<class_GutInputSender_method_get_auto_flush_input>`
|
|
|
|
Get the value of :ref:`set_auto_flush_input<class_GutInputSender_method_set_auto_flush_input>`.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GutInputSender_method_set_auto_flush_input:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **set_auto_flush_input**\ (\ val\ ) :ref:`🔗<class_GutInputSender_method_set_auto_flush_input>`
|
|
|
|
Enable/Disable auto flushing of input. When enabled the **GutInputSender** will call ``Input.flush_buffered_events`` after each event is sent. See the "use_accumulated_input" section in `Mocking-Input <../Mocking-Input.html>`__ for more information.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GutInputSender_method_wait:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
`Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ **wait**\ (\ t\ ) :ref:`🔗<class_GutInputSender_method_wait>`
|
|
|
|
Adds a delay between the last input queue item added and any queue item added next. By default this will wait ``t`` seconds. You can specify a number of frames to wait by passing a string composed of a number and "f". For example ``wait("5f")`` will wait 5 frames.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GutInputSender_method_clear:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **clear**\ (\ ) :ref:`🔗<class_GutInputSender_method_clear>`
|
|
|
|
Clears the input queue and any state such as the last event sent and any pressed actions/buttons. Does not clear the list of receivers.
|
|
|
|
|
|
|
|
This should be done between each test when the **GutInputSender** is a class level variable so that state does not leak between tests.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GutInputSender_method_key_up:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
`Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ **key_up**\ (\ which\ ) :ref:`🔗<class_GutInputSender_method_key_up>`
|
|
|
|
Sends a `InputEventKey <https://docs.godotengine.org/en/stable/classes/class_inputeventkey.html>`_ event with ``pressed = false``. ``which`` can be a character or a ``KEY_*`` constant.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GutInputSender_method_key_down:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
`Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ **key_down**\ (\ which\ ) :ref:`🔗<class_GutInputSender_method_key_down>`
|
|
|
|
Sends a `InputEventKey <https://docs.godotengine.org/en/stable/classes/class_inputeventkey.html>`_ event with ``pressed = true``. ``which`` can be a character or a ``KEY_*`` constant.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GutInputSender_method_key_echo:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
`Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ **key_echo**\ (\ ) :ref:`🔗<class_GutInputSender_method_key_echo>`
|
|
|
|
Sends an echo `InputEventKey <https://docs.godotengine.org/en/stable/classes/class_inputeventkey.html>`_ event of the last key event.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GutInputSender_method_action_up:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
`Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ **action_up**\ (\ which, strength = 1.0\ ) :ref:`🔗<class_GutInputSender_method_action_up>`
|
|
|
|
Sends a "action up" `InputEventAction <https://docs.godotengine.org/en/stable/classes/class_inputeventaction.html>`_ instance. ``which`` is the name of the action defined in the Key Map.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GutInputSender_method_action_down:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
`Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ **action_down**\ (\ which, strength = 1.0\ ) :ref:`🔗<class_GutInputSender_method_action_down>`
|
|
|
|
Sends a "action down" `InputEventAction <https://docs.godotengine.org/en/stable/classes/class_inputeventaction.html>`_ instance. ``which`` is the name of the action defined in the Key Map.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GutInputSender_method_mouse_left_button_down:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
`Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ **mouse_left_button_down**\ (\ position = null, global_position = null\ ) :ref:`🔗<class_GutInputSender_method_mouse_left_button_down>`
|
|
|
|
Sends a "button down" `InputEventMouseButton <https://docs.godotengine.org/en/stable/classes/class_inputeventmousebutton.html>`_ for the left mouse button.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GutInputSender_method_mouse_left_button_up:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
`Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ **mouse_left_button_up**\ (\ position = null, global_position = null\ ) :ref:`🔗<class_GutInputSender_method_mouse_left_button_up>`
|
|
|
|
Sends a "button up" `InputEventMouseButton <https://docs.godotengine.org/en/stable/classes/class_inputeventmousebutton.html>`_ for the left mouse button.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GutInputSender_method_mouse_double_click:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
`Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ **mouse_double_click**\ (\ position = null, global_position = null\ ) :ref:`🔗<class_GutInputSender_method_mouse_double_click>`
|
|
|
|
Sends a "double click" `InputEventMouseButton <https://docs.godotengine.org/en/stable/classes/class_inputeventmousebutton.html>`_ for the left mouse button.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GutInputSender_method_mouse_right_button_down:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
`Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ **mouse_right_button_down**\ (\ position = null, global_position = null\ ) :ref:`🔗<class_GutInputSender_method_mouse_right_button_down>`
|
|
|
|
Sends a "button down" `InputEventMouseButton <https://docs.godotengine.org/en/stable/classes/class_inputeventmousebutton.html>`_ for the right mouse button.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GutInputSender_method_mouse_right_button_up:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
`Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ **mouse_right_button_up**\ (\ position = null, global_position = null\ ) :ref:`🔗<class_GutInputSender_method_mouse_right_button_up>`
|
|
|
|
Sends a "button up" `InputEventMouseButton <https://docs.godotengine.org/en/stable/classes/class_inputeventmousebutton.html>`_ for the right mouse button.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GutInputSender_method_mouse_motion:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
`Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ **mouse_motion**\ (\ position, global_position = null\ ) :ref:`🔗<class_GutInputSender_method_mouse_motion>`
|
|
|
|
Sends a `InputEventMouseMotion <https://docs.godotengine.org/en/stable/classes/class_inputeventmousemotion.html>`_ to move the mouse the specified positions.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GutInputSender_method_mouse_relative_motion:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
`Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ **mouse_relative_motion**\ (\ offset, speed = Vector2(0, 0)\ ) :ref:`🔗<class_GutInputSender_method_mouse_relative_motion>`
|
|
|
|
Sends a `InputEventMouseMotion <https://docs.godotengine.org/en/stable/classes/class_inputeventmousemotion.html>`_ that moves the mouse ``offset`` from the last :ref:`mouse_motion<class_GutInputSender_method_mouse_motion>` or :ref:`mouse_set_position<class_GutInputSender_method_mouse_set_position>` call.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GutInputSender_method_mouse_set_position:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
`Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ **mouse_set_position**\ (\ position, global_position = null\ ) :ref:`🔗<class_GutInputSender_method_mouse_set_position>`
|
|
|
|
Sets the mouse's position. This does not send an event. This position will be used for the next call to :ref:`mouse_relative_motion<class_GutInputSender_method_mouse_relative_motion>`.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GutInputSender_method_mouse_left_click_at:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
`Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ **mouse_left_click_at**\ (\ where, duration = "5f"\ ) :ref:`🔗<class_GutInputSender_method_mouse_left_click_at>`
|
|
|
|
Performs a left click at the given position.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GutInputSender_method_send_event:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
`Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ **send_event**\ (\ event\ ) :ref:`🔗<class_GutInputSender_method_send_event>`
|
|
|
|
Create your own event and use this to send it to all receivers.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GutInputSender_method_release_all:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
`Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ **release_all**\ (\ ) :ref:`🔗<class_GutInputSender_method_release_all>`
|
|
|
|
Releases all `InputEventKey <https://docs.godotengine.org/en/stable/classes/class_inputeventkey.html>`_, `InputEventAction <https://docs.godotengine.org/en/stable/classes/class_inputeventaction.html>`_, and `InputEventMouseButton <https://docs.godotengine.org/en/stable/classes/class_inputeventmousebutton.html>`_ events that have passed through this instance. These events could have been generated via the various ``_down`` methods or passed to :ref:`send_event<class_GutInputSender_method_send_event>`.
|
|
|
|
|
|
|
|
This will send the "release" event (``pressed = false``) to all receivers. This should be done between each test when using `Input` as a receiver.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GutInputSender_method_wait_frames:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
`Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ **wait_frames**\ (\ num_frames\ ) :ref:`🔗<class_GutInputSender_method_wait_frames>`
|
|
|
|
Same as :ref:`wait<class_GutInputSender_method_wait>` but only accepts a number of frames to wait.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GutInputSender_method_wait_secs:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
`Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ **wait_secs**\ (\ num_secs\ ) :ref:`🔗<class_GutInputSender_method_wait_secs>`
|
|
|
|
Same as :ref:`wait<class_GutInputSender_method_wait>` but only accepts a number of seconds to wait.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GutInputSender_method_hold_for:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
`Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ **hold_for**\ (\ duration\ ) :ref:`🔗<class_GutInputSender_method_hold_for>`
|
|
|
|
This is a special :ref:`wait<class_GutInputSender_method_wait>` that will emit the previous input queue item with ``pressed = false`` after a delay. If you pass a number then it will wait that many seconds. You can also use the `"4f"` format to wait a specific number of frames.
|
|
|
|
|
|
|
|
For example ``sender.action_down('jump').hold_for("10f")`` will cause two `InputEventAction <https://docs.godotengine.org/en/stable/classes/class_inputeventaction.html>`_ instances to be sent. The "jump-down" event from :ref:`action_down<class_GutInputSender_method_action_down>` and then a "jump-up" event after 10 frames.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GutInputSender_method_hold_frames:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
`Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ **hold_frames**\ (\ duration\: `int <https://docs.godotengine.org/en/stable/classes/class_int.html>`_\ ) :ref:`🔗<class_GutInputSender_method_hold_frames>`
|
|
|
|
Same as :ref:`hold_for<class_GutInputSender_method_hold_for>` but specifically holds for a number of physics frames.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GutInputSender_method_hold_seconds:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
`Variant <https://docs.godotengine.org/en/stable/classes/class_variant.html>`_ **hold_seconds**\ (\ duration\: `float <https://docs.godotengine.org/en/stable/classes/class_float.html>`_\ ) :ref:`🔗<class_GutInputSender_method_hold_seconds>`
|
|
|
|
Same as :ref:`hold_for<class_GutInputSender_method_hold_for>` but specifically holds for a number of seconds.
|
|
|
|
.. |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.)`
|