Files
godot-docs-l10n/classes/es/class_inputevent.rst
Rémi Verschelde cf78697eea Add localized class reference as pre-generated RST files
Currently including `zh_CN` and `es` which both have very high completion
ratios. Others will be added once they reach a significant percentage too.

These RST files will be used by godot-docs in place of its `classes` folder
after we sync with https://github.com/godotengine/godot-docs/pull/5458.

The update workflow is manual for now (example for `zh_CN`):

- Build `godotengine/godot` in the branch we currently track (now `3.x`)
- Run `godot --doctool -l zh_CN`
- Run `cd doc && make rst LANGARG=zh_CN`
- Copy `doc/_build/rst/*` to `classes/zh_CN/` here
- Make sure to have `classes/zh_CN/index.rst` copied from `docs/classes`
2021-12-21 16:07:55 +01:00

191 lines
14 KiB
ReStructuredText

:github_url: hide
.. Generated automatically by doc/tools/make_rst.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/<name>/doc_classes.
.. _class_InputEvent:
InputEvent
==========
**Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
**Inherited By:** :ref:`InputEventAction<class_InputEventAction>`, :ref:`InputEventJoypadButton<class_InputEventJoypadButton>`, :ref:`InputEventJoypadMotion<class_InputEventJoypadMotion>`, :ref:`InputEventMIDI<class_InputEventMIDI>`, :ref:`InputEventScreenDrag<class_InputEventScreenDrag>`, :ref:`InputEventScreenTouch<class_InputEventScreenTouch>`, :ref:`InputEventWithModifiers<class_InputEventWithModifiers>`
Evento de entrada genérico.
Descripción
----------------------
Clase base de todo tipo de evento de entrada. Ver :ref:`Node._input<class_Node_method__input>`.
Tutoriales
--------------------
- :doc:`InputEvent <../tutorials/inputs/inputevent>`
- :doc:`Viewport and canvas transforms <../tutorials/2d/2d_transforms>`
- `2D Dodge The Creeps Demo <https://godotengine.org/asset-library/asset/515>`__
- `3D Voxel Demo <https://godotengine.org/asset-library/asset/676>`__
Propiedades
----------------------
+-----------------------+-------------------------------------------------+-------+
| :ref:`int<class_int>` | :ref:`device<class_InputEvent_property_device>` | ``0`` |
+-----------------------+-------------------------------------------------+-------+
Métodos
--------------
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`accumulate<class_InputEvent_method_accumulate>` **(** :ref:`InputEvent<class_InputEvent>` with_event **)** |
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`as_text<class_InputEvent_method_as_text>` **(** **)** |const| |
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_action_strength<class_InputEvent_method_get_action_strength>` **(** :ref:`String<class_String>` action, :ref:`bool<class_bool>` exact_match=false **)** |const| |
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_action<class_InputEvent_method_is_action>` **(** :ref:`String<class_String>` action, :ref:`bool<class_bool>` exact_match=false **)** |const| |
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_action_pressed<class_InputEvent_method_is_action_pressed>` **(** :ref:`String<class_String>` action, :ref:`bool<class_bool>` allow_echo=false, :ref:`bool<class_bool>` exact_match=false **)** |const| |
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_action_released<class_InputEvent_method_is_action_released>` **(** :ref:`String<class_String>` action, :ref:`bool<class_bool>` exact_match=false **)** |const| |
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_action_type<class_InputEvent_method_is_action_type>` **(** **)** |const| |
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_echo<class_InputEvent_method_is_echo>` **(** **)** |const| |
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_pressed<class_InputEvent_method_is_pressed>` **(** **)** |const| |
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`shortcut_match<class_InputEvent_method_shortcut_match>` **(** :ref:`InputEvent<class_InputEvent>` event, :ref:`bool<class_bool>` exact_match=true **)** |const| |
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`InputEvent<class_InputEvent>` | :ref:`xformed_by<class_InputEvent_method_xformed_by>` **(** :ref:`Transform2D<class_Transform2D>` xform, :ref:`Vector2<class_Vector2>` local_ofs=Vector2( 0, 0 ) **)** |const| |
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Descripciones de Propiedades
--------------------------------------------------------
.. _class_InputEvent_property_device:
- :ref:`int<class_int>` **device**
+-----------+-------------------+
| *Default* | ``0`` |
+-----------+-------------------+
| *Setter* | set_device(value) |
+-----------+-------------------+
| *Getter* | get_device() |
+-----------+-------------------+
El ID del dispositivo del evento.
\ **Nota:** Este ID de dispositivo siempre será ``-1`` para la entrada emulada del ratón desde una pantalla táctil. Puede utilizarse para distinguir la entrada de ratón emulada de la entrada de ratón física.
Descripciones de Métodos
------------------------------------------------
.. _class_InputEvent_method_accumulate:
- :ref:`bool<class_bool>` **accumulate** **(** :ref:`InputEvent<class_InputEvent>` with_event **)**
Devuelve ``true`` si el evento de entrada dado y este evento de entrada se pueden sumar (sólo para eventos del tipo :ref:`InputEventMouseMotion<class_InputEventMouseMotion>`).
Se copiarán la posición, la posición global y la velocidad del evento de entrada dado. El ``relativo`` resultante es una suma de ambos eventos. Los modificadores de ambos eventos tienen que ser idénticos.
----
.. _class_InputEvent_method_as_text:
- :ref:`String<class_String>` **as_text** **(** **)** |const|
Devuelve una representación :ref:`String<class_String>` del evento.
----
.. _class_InputEvent_method_get_action_strength:
- :ref:`float<class_float>` **get_action_strength** **(** :ref:`String<class_String>` action, :ref:`bool<class_bool>` exact_match=false **)** |const|
Returns a value between 0.0 and 1.0 depending on the given actions' state. Useful for getting the value of events of type :ref:`InputEventJoypadMotion<class_InputEventJoypadMotion>`.
If ``exact_match`` is ``false``, it ignores the input modifiers for :ref:`InputEventKey<class_InputEventKey>` and :ref:`InputEventMouseButton<class_InputEventMouseButton>` events, and the direction for :ref:`InputEventJoypadMotion<class_InputEventJoypadMotion>` events.
----
.. _class_InputEvent_method_is_action:
- :ref:`bool<class_bool>` **is_action** **(** :ref:`String<class_String>` action, :ref:`bool<class_bool>` exact_match=false **)** |const|
Returns ``true`` if this input event matches a pre-defined action of any type.
If ``exact_match`` is ``false``, it ignores the input modifiers for :ref:`InputEventKey<class_InputEventKey>` and :ref:`InputEventMouseButton<class_InputEventMouseButton>` events, and the direction for :ref:`InputEventJoypadMotion<class_InputEventJoypadMotion>` events.
----
.. _class_InputEvent_method_is_action_pressed:
- :ref:`bool<class_bool>` **is_action_pressed** **(** :ref:`String<class_String>` action, :ref:`bool<class_bool>` allow_echo=false, :ref:`bool<class_bool>` exact_match=false **)** |const|
Returns ``true`` if the given action is being pressed (and is not an echo event for :ref:`InputEventKey<class_InputEventKey>` events, unless ``allow_echo`` is ``true``). Not relevant for events of type :ref:`InputEventMouseMotion<class_InputEventMouseMotion>` or :ref:`InputEventScreenDrag<class_InputEventScreenDrag>`.
If ``exact_match`` is ``false``, it ignores the input modifiers for :ref:`InputEventKey<class_InputEventKey>` and :ref:`InputEventMouseButton<class_InputEventMouseButton>` events, and the direction for :ref:`InputEventJoypadMotion<class_InputEventJoypadMotion>` events.
----
.. _class_InputEvent_method_is_action_released:
- :ref:`bool<class_bool>` **is_action_released** **(** :ref:`String<class_String>` action, :ref:`bool<class_bool>` exact_match=false **)** |const|
Returns ``true`` if the given action is released (i.e. not pressed). Not relevant for events of type :ref:`InputEventMouseMotion<class_InputEventMouseMotion>` or :ref:`InputEventScreenDrag<class_InputEventScreenDrag>`.
If ``exact_match`` is ``false``, it ignores the input modifiers for :ref:`InputEventKey<class_InputEventKey>` and :ref:`InputEventMouseButton<class_InputEventMouseButton>` events, and the direction for :ref:`InputEventJoypadMotion<class_InputEventJoypadMotion>` events.
----
.. _class_InputEvent_method_is_action_type:
- :ref:`bool<class_bool>` **is_action_type** **(** **)** |const|
Devuelve ``true`` si el tipo de este evento de entrada es uno que puede ser asignado a una acción de entrada.
----
.. _class_InputEvent_method_is_echo:
- :ref:`bool<class_bool>` **is_echo** **(** **)** |const|
Devuelve ``true`` si este evento de entrada es un evento de eco (sólo para eventos del tipo :ref:`InputEventKey<class_InputEventKey>`).
----
.. _class_InputEvent_method_is_pressed:
- :ref:`bool<class_bool>` **is_pressed** **(** **)** |const|
Devuelve ``true`` si se pulsa este evento de entrada. No es relevante para eventos del tipo :ref:`InputEventMouseMotion<class_InputEventMouseMotion>` o :ref:`InputEventScreenDrag<class_InputEventScreenDrag>`.
----
.. _class_InputEvent_method_shortcut_match:
- :ref:`bool<class_bool>` **shortcut_match** **(** :ref:`InputEvent<class_InputEvent>` event, :ref:`bool<class_bool>` exact_match=true **)** |const|
Returns ``true`` if the specified ``event`` matches this event. Only valid for action events i.e key (:ref:`InputEventKey<class_InputEventKey>`), button (:ref:`InputEventMouseButton<class_InputEventMouseButton>` or :ref:`InputEventJoypadButton<class_InputEventJoypadButton>`), axis :ref:`InputEventJoypadMotion<class_InputEventJoypadMotion>` or action (:ref:`InputEventAction<class_InputEventAction>`) events.
If ``exact_match`` is ``false``, it ignores the input modifiers for :ref:`InputEventKey<class_InputEventKey>` and :ref:`InputEventMouseButton<class_InputEventMouseButton>` events, and the direction for :ref:`InputEventJoypadMotion<class_InputEventJoypadMotion>` events.
----
.. _class_InputEvent_method_xformed_by:
- :ref:`InputEvent<class_InputEvent>` **xformed_by** **(** :ref:`Transform2D<class_Transform2D>` xform, :ref:`Vector2<class_Vector2>` local_ofs=Vector2( 0, 0 ) **)** |const|
Devuelve una copia del evento de entrada dado que ha sido dezplazado por ``local_ofs`` y transformado por ``xform``. Relevante para eventos del tipo :ref:`InputEventMouseButton<class_InputEventMouseButton>`, :ref:`InputEventMouseMotion<class_InputEventMouseMotion>`, :ref:`InputEventScreenTouch<class_InputEventScreenTouch>`, :ref:`InputEventScreenDrag<class_InputEventScreenDrag>`, :ref:`InputEventMagnifyGesture<class_InputEventMagnifyGesture>` y :ref:`InputEventPanGesture<class_InputEventPanGesture>`.
.. |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.)`