InputEventAction

Hereda: InputEvent < Resource < RefCounted < Object

Un tipo de evento de entrada para acciones.

Descripción

Contains a generic action which can be targeted from several types of inputs. Actions and their events can be set in the Input Map tab in Project > Project Settings, or with the InputMap class.

Note: Unlike the other InputEvent subclasses which map to unique physical events, this virtual one is not emitted by the engine. This class is useful to emit actions manually with Input.parse_input_event(), which are then received in Node._input(). To check if a physical event matches an action from the Input Map, use InputEvent.is_action() and InputEvent.is_action_pressed().

Tutoriales

Propiedades

StringName

action

&""

int

event_index

-1

bool

pressed

false

float

strength

1.0


Descripciones de Propiedades

StringName action = &"" 🔗

El nombre de la acción. Normalmente es el nombre de una acción existente en el InputMap con la que quieres que coincida este evento personalizado.


int event_index = -1 🔗

  • void set_event_index(value: int)

  • int get_event_index()

El índice del evento real en la acción a la que corresponde este evento (de los eventos definidos para esta acción en el InputMap). Si es -1, se utilizará un ID único y las acciones pulsadas con este ID deberán liberarse con otro InputEventAction.


bool pressed = false 🔗

  • void set_pressed(value: bool)

  • bool is_pressed()

Si es true, se presiona el estado de la acción. Si false, se libera el estado de la acción.


float strength = 1.0 🔗

  • void set_strength(value: float)

  • float get_strength()

La fuerza de la acción entre 0 y 1. Este valor se considera igual a 0 si pressed es false. La fuerza del evento permite simular eventos de movimiento analógico del joypad, especificando la fuerza con la que se dobla o presiona el eje del joypad.