-
Notifications
You must be signed in to change notification settings - Fork 0
Input
Home | API by Category | Complete API Index | API Compatibility
| Field | Value |
|---|---|
| Full name | Electron2D.Input |
| Namespace | Electron2D |
| Kind | class |
| Category | Input |
Provides process-wide action input state.
public static class Electron2D.InputProfile: Electron2D 0.1.0 2D
Status: Partial / Not verified
Out of profile: yes
Godot reference: Input
Process-wide action state queries for pressed, just-pressed, strength and four-action vectors.
The input state is fed by Electron2D.SceneTree.DispatchInput(Electron2D.InputEvent)
through the action bindings registered in Electron2D.InputMap. It stores
frame-local transition state such as Electron2D.Input.IsActionJustPressed(System.String,System.Boolean).
0.1.0 Preview supports keyboard bindings, mouse button bindings, gamepad
bindings and direct Electron2D.InputEventAction events. Touch input is
delivered as screen touch and drag events and is not an action binding in
this baseline.
All methods synchronize access to the process-wide input state.
This class is available since Electron2D 0.1.0 Preview.
Electron2D.InputMap
| Member | Kind | Summary |
|---|---|---|
GetActionStrength(System.String, System.Boolean) |
Method | Gets the current strength of an action. |
GetConnectedJoypads() |
Method | Gets the connected gamepad device ids. |
GetJoyAxis(System.Int32, Electron2D.JoyAxis) |
Method | Gets the last known value for a gamepad axis. |
GetJoyName(System.Int32) |
Method | Gets the display name for a connected gamepad. |
GetJoyVibrationDuration(System.Int32) |
Method | Gets the active vibration duration for a gamepad. |
GetJoyVibrationStrength(System.Int32) |
Method | Gets the active vibration strength for a gamepad. |
GetVector(System.String, System.String, System.String, System.String, System.Single) |
Method | Gets a 2D vector from four directional actions. |
IsActionJustPressed(System.String, System.Boolean) |
Method | Checks whether an action became pressed during the current frame. |
IsActionPressed(System.String, System.Boolean) |
Method | Checks whether an action is currently pressed. |
IsJoyButtonPressed(System.Int32, Electron2D.JoyButton) |
Method | Checks whether a gamepad button is currently pressed. |
IsJoyKnown(System.Int32) |
Method | Checks whether a connected gamepad uses a known mapping. |
StartJoyVibration(System.Int32, System.Single, System.Single, System.Single) |
Method | Starts gamepad vibration when the device supports it. |
StopJoyVibration(System.Int32) |
Method | Stops gamepad vibration. |
Kind: Method
public static System.Single GetActionStrength(System.String, System.Boolean)(System.String action, System.Boolean exactMatch)Gets the current strength of an action.
This method follows the validation and lifetime rules of its declaring type.
-
action: The action name to query. -
exactMatch: Reserved for exact modifier/device matching in future input work.
The action strength in the range 0.0 through 1.0, or
0.0 for unknown or released actions.
-
System.ArgumentException: Thrown whenactionis empty.
This method is safe to call from any thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.InputMap.ActionGetDeadzone(System.String)
Kind: Method
public static System.Int32[] GetConnectedJoypads()()Gets the connected gamepad device ids.
Device ids are runtime-local identifiers reported by the platform input layer. They are not stable across process restarts and should not be persisted in project files.
A stable ascending snapshot of connected gamepad device ids.
This method is safe to call from any thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Input.GetJoyName(System.Int32)Electron2D.Input.IsJoyKnown(System.Int32)
Kind: Method
public static System.Single GetJoyAxis(System.Int32, Electron2D.JoyAxis)(System.Int32 device, Electron2D.JoyAxis axis)Gets the last known value for a gamepad axis.
The value is updated when an Electron2D.InputEventJoypadMotion is
dispatched through Electron2D.SceneTree. Unknown devices and invalid
axes fail closed and return zero.
-
device: The runtime-local gamepad device id. -
axis: The axis to query.
The normalized axis value in the range -1.0 through 1.0,
or 0.0 when the device or axis is unknown.
This method is safe to call from any thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.InputEventJoypadMotion
Kind: Method
public static System.String GetJoyName(System.Int32)(System.Int32 device)Gets the display name for a connected gamepad.
This method follows the validation and lifetime rules of its declaring type.
-
device: The runtime-local gamepad device id.
The device name, or an empty string when the device is unknown or has no reported name.
This method is safe to call from any thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Input.GetConnectedJoypads
Kind: Method
public static System.Single GetJoyVibrationDuration(System.Int32)(System.Int32 device)Gets the active vibration duration for a gamepad.
A duration of 0.0 can also represent an indefinite active effect.
Use Electron2D.Input.GetJoyVibrationStrength(System.Int32) to distinguish an
indefinite active effect from an inactive device.
-
device: The runtime-local gamepad device id.
The requested vibration duration in seconds, or 0.0 when no
vibration is active or the device is unknown.
This method is safe to call from any thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Input.StartJoyVibration(System.Int32,System.Single,System.Single,System.Single)Electron2D.Input.StopJoyVibration(System.Int32)
Kind: Method
public static Electron2D.Vector2 GetJoyVibrationStrength(System.Int32)(System.Int32 device)Gets the active vibration strength for a gamepad.
Unknown or unsupported devices return Electron2D.Vector2.Zero.
-
device: The runtime-local gamepad device id.
A vector where Electron2D.Vector2.X is the weak motor strength and
Electron2D.Vector2.Y is the strong motor strength. Both components are
in the range 0.0 through 1.0.
This method is safe to call from any thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Input.StartJoyVibration(System.Int32,System.Single,System.Single,System.Single)Electron2D.Input.StopJoyVibration(System.Int32)
Kind: Method
public static Electron2D.Vector2 GetVector(System.String, System.String, System.String, System.String, System.Single)(System.String negativeX, System.String positiveX, System.String negativeY, System.String positiveY, System.Single deadzone)Gets a 2D vector from four directional actions.
This method follows the validation and lifetime rules of its declaring type.
-
negativeX: The action used for negative X movement. -
positiveX: The action used for positive X movement. -
negativeY: The action used for negative Y movement. -
positiveY: The action used for positive Y movement. -
deadzone: The vector deadzone. Use a negative value to average the four action deadzones fromElectron2D.InputMap.
A vector whose components are built from action strengths and whose
length is clamped to 1.0.
-
System.ArgumentException: Thrown when any action name is empty ordeadzoneis not finite.
This method is safe to call from any thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Input.GetActionStrength(System.String,System.Boolean)
Kind: Method
public static System.Boolean IsActionJustPressed(System.String, System.Boolean)(System.String action, System.Boolean exactMatch)Checks whether an action became pressed during the current frame.
This method follows the validation and lifetime rules of its declaring type.
-
action: The action name to query. -
exactMatch: Reserved for exact modifier/device matching in future input work.
true when the action transitioned from released to pressed since
the previous transition flush; otherwise, false.
-
System.ArgumentException: Thrown whenactionis empty.
This method is safe to call from any thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Input.IsActionPressed(System.String,System.Boolean)
Kind: Method
public static System.Boolean IsActionPressed(System.String, System.Boolean)(System.String action, System.Boolean exactMatch)Checks whether an action is currently pressed.
This method follows the validation and lifetime rules of its declaring type.
-
action: The action name to query. -
exactMatch: Reserved for exact modifier/device matching in future input work.
true when the action currently has a positive strength;
otherwise, false.
-
System.ArgumentException: Thrown whenactionis empty.
This method is safe to call from any thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Input.GetActionStrength(System.String,System.Boolean)
Kind: Method
public static System.Boolean IsJoyButtonPressed(System.Int32, Electron2D.JoyButton)(System.Int32 device, Electron2D.JoyButton button)Checks whether a gamepad button is currently pressed.
The state is updated by Electron2D.InputEventJoypadButton dispatch.
Invalid buttons and unknown devices return false.
-
device: The runtime-local gamepad device id. -
button: The button to query.
true when the button is pressed on the connected device;
otherwise, false.
This method is safe to call from any thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.InputEventJoypadButton
Kind: Method
public static System.Boolean IsJoyKnown(System.Int32)(System.Int32 device)Checks whether a connected gamepad uses a known mapping.
Devices created from button or axis events without metadata are treated as unknown until the platform input layer supplies mapping information.
-
device: The runtime-local gamepad device id.
true when the device is connected and its mapping is known;
otherwise, false.
This method is safe to call from any thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Input
Kind: Method
public static System.Void StartJoyVibration(System.Int32, System.Single, System.Single, System.Single)(System.Int32 device, System.Single weakMagnitude, System.Single strongMagnitude, System.Single duration)Starts gamepad vibration when the device supports it.
Magnitudes are clamped to 0.0 through 1.0. Unknown devices
and devices without vibration support are ignored without throwing.
This baseline records the requested state for the platform backend. It does not expose native haptic handles through the public API.
-
device: The runtime-local gamepad device id. -
weakMagnitude: The weak motor strength. -
strongMagnitude: The strong motor strength. -
duration: The duration in seconds. Values less than or equal to0.0request an indefinite effect.
-
System.ArgumentException: Thrown whenweakMagnitude,strongMagnitudeordurationis not finite.
This method is safe to call from any thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Input.GetJoyVibrationStrength(System.Int32)Electron2D.Input.StopJoyVibration(System.Int32)
Kind: Method
public static System.Void StopJoyVibration(System.Int32)(System.Int32 device)Stops gamepad vibration.
Unknown devices and devices without vibration support are ignored without throwing.
-
device: The runtime-local gamepad device id.
This method is safe to call from any thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Input.StartJoyVibration(System.Int32,System.Single,System.Single,System.Single)
Electron2D 0.1.0 Preview API reference. Generated from 175 public runtime types.