GamepadInput
Summary
Provides polling access, configuration settings, and event-driven dispatching for gamepad buttons and analogue axes across connected devices.
Remarks
Danger
All calls made within this class MUST be performed on the Master Thread.
See RunLater on how to safely call this from an asynchronous thread.
Failure to comply with this can cause catastrophical failures as the engine is not designed for this.
Definition
Namespace: SDT4.Managed.Input.Gamepad
Assembly: SDT4.Managed.Input.dll
static class GamepadInput
Inheritance:
Object ➔ GamepadInput
Implements:
Fields
| Name | Type | Description |
|---|---|---|
Properties
| Name | Type | Description |
|---|---|---|
public static get; set; RolloverTime |
Single | Gets or sets the time window (in seconds) between initially holding the game press before the repeat event occurs. |
public static get; set; RepeatDelay |
Single | Gets or sets the delay (in seconds) between repeated press events for buttons. |
public static get; set; InnerAxisDeadzone |
Single | Gets or sets the inner deadzone threshold applied to all gamepad analog axes. Axis inputs below this magnitude are clamped to 0.0, and remaining values are rescaled accordingly. |
public static get; set; OuterAxisDeadzone |
Single | Gets or sets the outer deadzone threshold applied to all gamepad analog axes. Axis inputs above this magnitude are clamped to 1.0, and remaining values are rescaled accordingly. |
InnerAxisDeadzone Remarks
Default is
OuterAxisDeadzone Remarks
Default is
Methods
public static Boolean IsButtonDown(GamepadIdentifier deviceId, GamepadButton button)
Summary: Retrieves whether the specified button is currently held down on the target gamepad.
Remarks:
Note
In the case of: - GamepadButton.LeftStickUp - GamepadButton.LeftStickRight - GamepadButton.LeftStickDown - GamepadButton.LeftStickLeft - GamepadButton.RightStickUp - GamepadButton.RightStickRight - GamepadButton.RightStickDown - GamepadButton.RightStickLeft - GamepadButton.RightTrigger - GamepadButton.LeftTrigger The input is emulated by polling the axis until it passes the deadzone threshold. Emulated repeat triggers can be configured via GamepadInput.RolloverTime and GamepadInput.RepeatDelay.
Parameters:
-
deviceId(GamepadIdentifier): The identifier representing the target gamepad device. -
button(GamepadButton): The button to query state for.
Returns:
- Boolean:
if the device is connected and the button is pressed; otherwise, .
public static Double GetAxisValue(GamepadIdentifier deviceId, GamepadAxis axis)
Summary: Retrieves the post-processed, deadzone-adjusted value of an analog axis on the target gamepad.
Parameters:
-
deviceId(GamepadIdentifier): The identifier representing the target gamepad device. -
axis(GamepadAxis): The analog axis to query.
Returns:
- Double: The adjusted axis value (typically normalized between -1.0 and 1.0, or 0.0 and 1.0 for triggers),
or
0.0 if the device is not connected.
public static Double GetRawAxisValue(GamepadIdentifier deviceId, GamepadAxis axis)
Summary: Queries the native layer directly for the raw, unmapped, and unfiltered hardware axis value.
Parameters:
-
deviceId(GamepadIdentifier): The identifier representing the target gamepad device. -
axis(GamepadAxis): The analog axis to query.
Returns:
- Double: The unmodified native axis value, or
0.0 if the device is not connected.