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

int

device

0

Métodos

bool

accumulate ( InputEvent with_event )

String

as_text ( ) const

float

get_action_strength ( String action, bool exact_match=false ) const

bool

is_action ( String action, bool exact_match=false ) const

bool

is_action_pressed ( String action, bool allow_echo=false, bool exact_match=false ) const

bool

is_action_released ( String action, bool exact_match=false ) const

bool

is_action_type ( ) const

bool

is_echo ( ) const

bool

is_pressed ( ) const

bool

shortcut_match ( InputEvent event, bool exact_match=true ) const

InputEvent

xformed_by ( Transform2D xform, Vector2 local_ofs=Vector2( 0, 0 ) ) const

Descripciones de Propiedades

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

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.


Devuelve una representación String del evento.


  • float get_action_strength ( String action, 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 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.


  • bool is_action_pressed ( String action, bool allow_echo=false, bool exact_match=false ) const

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.


  • bool is_action_released ( String action, bool exact_match=false ) const

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.


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.


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.