Skip to content

๐Ÿ“– API Reference: USonyGamepadProxy

rafaelvaloto edited this page Oct 6, 2025 · 3 revisions

Proxy class for interacting with Sony gamepad devices such as DualSense or DualShock controllers. This class provides static methods to handle various functionalities, including device status, connection type, battery levels, LED effects, motion sensor calibration, touch capabilities, and deprecation of certain methods.

Methods

DeviceIsConnected

Checks if the DualSense or DualShock device with the specified Controller ID is connected.

Parameters

  • ControllerId (int32): The ID of the controller to check for connectivity.

Returns

  • bool: True if the DualSense or DualShock device is connected, false otherwise.

GetDeviceType

Retrieves the type of the connected device (e.g., DualSense, DualSense Edge, or DualShock 4) based on the specified Controller ID.

Parameters

  • ControllerId (int32): The ID of the connected controller whose type is to be determined.

Returns

  • EDeviceType: The type of the device as an EDeviceType enum value. Possible values include:
    • DualSense
    • DualSenseEdge
    • DualShock4

GetConnectionType

Retrieves the connection type of the DualSense or DualShock device with the specified Controller ID.

Parameters

  • ControllerId (int32): The ID of the controller whose connection type is being queried.

Returns

  • EDeviceConnection: The connection type of the device, which can be USB, Bluetooth, or Unrecognized.

LevelBatteryDevice

Retrieves the battery level of the DualSense or DualShock controller for the specified controller ID.

Parameters

  • ControllerId (int32): The ID of the DualSense or DualShock controller to query.

Returns

  • float: The battery level of the controller as a float. Returns 0.0f if the library instance cannot be retrieved.

LedColorEffects

Updates the LED color effects on a DualSense or DualShock controller using the specified color.

Parameters

  • ControllerId (int32): The identifier of the controller whose LED color will be updated.
  • Color (FColor): The color to set on the controller's LED.
  • BrightnessTime (float): (DualShock 4) LED brightness transition time, in seconds. (min: 0.0, max: 2.5). Default is 0.0f.
  • ToogleTime (float): (DualShock 4) Toggle transition time, in seconds. (min: 0.0, max: 2.5). Default is 0.0f.

LedMicEffects

Controls the LED and microphone visual effects on a DualSense controller.

Parameters

  • ControllerId (int32): The ID of the DualSense controller to be affected.
  • Value (ELedMicEnum): The desired LED and microphone effect to apply.

StartMotionSensorCalibration

Initiates the motion sensor calibration process for the specified controller. The calibration adjusts the motion sensor sensitivity and dead zone settings.

Parameters

  • ControllerId (int32): The ID of the controller to be calibrated.
  • Duration (float): Calibration Duration (Seconds). The time in seconds to collect sensor data for calculating the stable center (baseline). Longer durations can provide a more accurate baseline. (min: 1.0, max: 10.0). Default is 2.0f.
  • DeadZone (float): Noise Deadzone Percentage. A percentage (0.0 to 1.0) of the sensor noise range to ignore after calibration. A higher value creates a larger deadzone, filtering out more residual noise but potentially ignoring very subtle movements. (min: 0.0, max: 1.0). Default is 0.5f.

GetMotionSensorCalibrationStatus

Retrieves the calibration status of the motion sensor for the specified controller.

Parameters

  • ControllerId (int32): The ID of the controller whose motion sensor calibration status is being queried.
  • Progress (float&): A reference to a variable where the calibration progress will be stored, expressed as a percentage.

Returns

  • bool: True if the calibration process is in progress, false otherwise.

EnableTouch

Enables or disables the touch functionality on a specified DualSense controller.

Parameters

  • ControllerId (int32): The identifier of the controller for which the touch functionality should be enabled or disabled.
  • bEnableTouch (bool): A boolean indicating whether to enable (true) or disable (false) the touch functionality.

EnableGyroscopeValues

Enables or disables the gyroscope functionality for a specified DualSense controller.

Parameters

  • ControllerId (int32): The ID of the controller for which the gyroscope functionality is to be modified.
  • bEnableGyroscope (bool): Set to true to enable the gyroscope, or false to disable it.

RemapControllerIdToUser

โš ๏ธ Deprecated: This method was refactored and deprecated as of plugin version v1.2.1. Please use the GamepadCoOp Plugin instead.

Remaps the specified gamepad ID to a new user and updates the old user's settings accordingly.


DeviceReconnect

โš ๏ธ Deprecated: This method was refactored and deprecated as of plugin version v1.2.10. Please use the GamepadCoOp Plugin instead.

Attempts to reconnect a DualSense or DualShock controller based on the given controller ID.


DeviceDisconnect

โš ๏ธ Deprecated: This method was refactored and deprecated as of plugin version v1.2.10.

Disconnects the DualSense or DualShock device associated with the given Controller ID.


EnableAccelerometerValues

โš ๏ธ Deprecated: This method was refactored and deprecated as of plugin version v1.2.14. Use EnableGyroscopeValues instead.

Enables or disables accelerometer values for the specified controller.

See Also