Class InputEventAction
- Namespace
- Godot
- Assembly
- GodotSharp.dll
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 ParseInputEvent(InputEvent), which are then received in _Input(InputEvent). To check if a physical event matches an action from the Input Map, use IsAction(StringName, bool) and IsActionPressed(StringName, bool, bool).
public class InputEventAction : InputEvent, IDisposable
- Inheritance
-
InputEventAction
- Implements
- Inherited Members
Constructors
InputEventAction()
public InputEventAction()
Properties
Action
The action's name. Actions are accessed via this string.
public StringName Action { get; set; }
Property Value
Pressed
If true
, the action's state is pressed. If false
, the action's state is released.
public bool Pressed { get; set; }
Property Value
Strength
The action's strength between 0 and 1. This value is considered as equal to 0 if pressed is false
. The event strength allows faking analog joypad motion events, by specifying how strongly the joypad axis is bent or pressed.
public float Strength { get; set; }
Property Value
Methods
HasGodotClassMethod(in godot_string_name)
Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.
protected override bool HasGodotClassMethod(in godot_string_name method)
Parameters
method
godot_string_nameName of the method to check for.
Returns
HasGodotClassSignal(in godot_string_name)
Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.
protected override bool HasGodotClassSignal(in godot_string_name signal)
Parameters
signal
godot_string_nameName of the signal to check for.
Returns
InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)
Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.
protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)
Parameters
method
godot_string_nameName of the method to invoke.
args
NativeVariantPtrArgsArguments to use with the invoked method.
ret
godot_variantValue returned by the invoked method.