InputEvent¶
Inherits: Resource < Reference < Object
Inherited By: InputEventAction, InputEventJoypadButton, InputEventJoypadMotion, InputEventMIDI, InputEventScreenDrag, InputEventScreenTouch, InputEventWithModifiers
Evento de entrada genérico.
Descripción¶
Clase base de todo tipo de evento de entrada. Ver Node._input.
Tutoriales¶
Propiedades¶
|
Métodos¶
accumulate ( InputEvent with_event ) |
|
as_text ( ) const |
|
get_action_strength ( String action, bool exact_match=false ) const |
|
is_action_pressed ( String action, bool allow_echo=false, bool exact_match=false ) const |
|
is_action_released ( String action, bool exact_match=false ) const |
|
is_action_type ( ) const |
|
is_echo ( ) const |
|
is_pressed ( ) const |
|
shortcut_match ( InputEvent event, bool exact_match=true ) const |
|
xformed_by ( Transform2D xform, Vector2 local_ofs=Vector2( 0, 0 ) ) const |
Descripciones de Propiedades¶
int device
Default |
|
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¶
bool accumulate ( 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 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.
String as_text ( ) const
Devuelve una representación String del evento.
Returns a value between 0.0 and 1.0 depending on the given actions' state. Useful for getting the value of events of type InputEventJoypadMotion.
If exact_match
is false
, it ignores the input modifiers for InputEventKey and InputEventMouseButton events, and the direction for InputEventJoypadMotion events.
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 InputEventKey and InputEventMouseButton events, and the direction for InputEventJoypadMotion events.
Returns true
if the given action is being pressed (and is not an echo event for InputEventKey events, unless allow_echo
is true
). Not relevant for events of type InputEventMouseMotion or InputEventScreenDrag.
If exact_match
is false
, it ignores the input modifiers for InputEventKey and InputEventMouseButton events, and the direction for InputEventJoypadMotion events.
Returns true
if the given action is released (i.e. not pressed). Not relevant for events of type InputEventMouseMotion or InputEventScreenDrag.
If exact_match
is false
, it ignores the input modifiers for InputEventKey and InputEventMouseButton events, and the direction for InputEventJoypadMotion events.
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.
bool is_echo ( ) const
Devuelve true
si este evento de entrada es un evento de eco (sólo para eventos del tipo InputEventKey).
bool is_pressed ( ) const
Devuelve true
si se pulsa este evento de entrada. No es relevante para eventos del tipo InputEventMouseMotion o InputEventScreenDrag.
bool shortcut_match ( InputEvent event, bool exact_match=true ) const
Returns true
if the specified event
matches this event. Only valid for action events i.e key (InputEventKey), button (InputEventMouseButton or InputEventJoypadButton), axis InputEventJoypadMotion or action (InputEventAction) events.
If exact_match
is false
, it ignores the input modifiers for InputEventKey and InputEventMouseButton events, and the direction for InputEventJoypadMotion events.
InputEvent xformed_by ( Transform2D xform, 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 InputEventMouseButton, InputEventMouseMotion, InputEventScreenTouch, InputEventScreenDrag, InputEventMagnifyGesture y InputEventPanGesture.