.. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the InputEvent.xml source instead. .. The source is found in doc/classes or modules//doc_classes. .. _class_InputEvent: InputEvent ========== **Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` **Inherited By:** :ref:`InputEventAction`, :ref:`InputEventJoypadButton`, :ref:`InputEventJoypadMotion`, :ref:`InputEventScreenDrag`, :ref:`InputEventScreenTouch`, :ref:`InputEventWithModifiers` **Category:** Core Brief Description ----------------- Generic input event Properties ---------- +-----------------------+-------------------------------------------------+ | :ref:`int` | :ref:`device` | +-----------------------+-------------------------------------------------+ Methods ------- +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`as_text` **(** **)** const | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_action_strength` **(** :ref:`String` action **)** const | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_action` **(** :ref:`String` action **)** const | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_action_pressed` **(** :ref:`String` action **)** const | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_action_released` **(** :ref:`String` action **)** const | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_action_type` **(** **)** const | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_echo` **(** **)** const | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_pressed` **(** **)** const | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`shortcut_match` **(** :ref:`InputEvent` event **)** const | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`InputEvent` | :ref:`xformed_by` **(** :ref:`Transform2D` xform, :ref:`Vector2` local_ofs=Vector2( 0, 0 ) **)** const | +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Description ----------- Base class of all sort of input event. See :ref:`Node._input`. Tutorials --------- - :doc:`../tutorials/inputs/inputevent` - :doc:`../tutorials/2d/2d_transforms` Property Descriptions --------------------- .. _class_InputEvent_property_device: - :ref:`int` **device** +----------+-------------------+ | *Setter* | set_device(value) | +----------+-------------------+ | *Getter* | get_device() | +----------+-------------------+ The event's device ID. Method Descriptions ------------------- .. _class_InputEvent_method_as_text: - :ref:`String` **as_text** **(** **)** const Returns a :ref:`String` representation of the event. .. _class_InputEvent_method_get_action_strength: - :ref:`float` **get_action_strength** **(** :ref:`String` action **)** const .. _class_InputEvent_method_is_action: - :ref:`bool` **is_action** **(** :ref:`String` action **)** const Returns ``true`` if this input event matches a pre-defined action of any type. .. _class_InputEvent_method_is_action_pressed: - :ref:`bool` **is_action_pressed** **(** :ref:`String` action **)** const Returns ``true`` if the given action is being pressed (and is not an echo event for KEY events). Not relevant for the event types ``MOUSE_MOTION``, ``SCREEN_DRAG`` or ``NONE``. .. _class_InputEvent_method_is_action_released: - :ref:`bool` **is_action_released** **(** :ref:`String` action **)** const Returns ``true`` if the given action is released (i.e. not pressed). Not relevant for the event types ``MOUSE_MOTION``, ``SCREEN_DRAG`` or ``NONE``. .. _class_InputEvent_method_is_action_type: - :ref:`bool` **is_action_type** **(** **)** const Returns ``true`` if this input event's type is one of the ``InputEvent`` constants. .. _class_InputEvent_method_is_echo: - :ref:`bool` **is_echo** **(** **)** const Returns ``true`` if this input event is an echo event (only for events of type KEY). .. _class_InputEvent_method_is_pressed: - :ref:`bool` **is_pressed** **(** **)** const Returns ``true`` if this input event is pressed. Not relevant for the event types ``MOUSE_MOTION``, ``SCREEN_DRAG`` or ``NONE``. .. _class_InputEvent_method_shortcut_match: - :ref:`bool` **shortcut_match** **(** :ref:`InputEvent` event **)** const .. _class_InputEvent_method_xformed_by: - :ref:`InputEvent` **xformed_by** **(** :ref:`Transform2D` xform, :ref:`Vector2` local_ofs=Vector2( 0, 0 ) **)** const