ISteamInput - adambiser/agk-steam-plugin GitHub Wiki

See the Steam Input documentation for more information. As of Steamworks SDK v1.43 Steam Controller is being deprecated.

Until the Steam Input API documentation has been posted, this will still link to ISteamController.

See also Getting Started for Developers.

ActivateActionSet

ActivateActionSet(hInput as integer, hActionSet as integer)

  • hInput - The handle of the input you want to activate an action set for.
  • hActionSet - The handle of the action set you want to activate.

Reconfigure the input to use the specified action set (ie "Menu", "Walk", or "Drive").

This is cheap, and can be safely called repeatedly. It's often easier to repeatedly call it in your state loops, instead of trying to place it in all of your state transitions.

Reference:
ISteamController#ActivateActionSet

ActivateActionSetLayer

ActivateActionSetLayer(hInput as integer, hActionSetLayer as integer)

  • hInput - The handle of the input you want to activate an action set layer for.
  • hActionSetLayer - The handle of the action set layer you want to activate.

Reconfigure the input to use the specified action set layer.

Reference:
ISteamController#ActivateActionSetLayer

DeactivateActionSetLayer

DeactivateActionSetLayer(hInput as integer, hActionSetLayer as integer)

  • hInput - The handle of the input you want to deactivate an action set layer for.
  • hActionSetLayer - The handle of the action set layer you want to deactivate.

Reconfigure the input to stop using the specified action set layer.

Reference:
ISteamController#DeactivateActionSetLayer

DeactivateAllActionSetLayers

DeactivateAllActionSetLayers(hInput as integer)

  • hInput - The handle of the input you want to deactivate all action set layers for.

Reconfigure the input to stop using all action set layers.

Reference:
ISteamController#DeactivateAllActionSetLayers

GetActiveActionSetLayerCount

GetActiveActionSetLayerCount(hInput as integer) as integer

  • hInput - The handle of the input you want to get active action set layers for.

Gets the number of active action set layers for the given input.

Returns: The number of active action set layers.

Reference:
ISteamController#GetActiveActionSetLayers

GetActiveActionSetLayerHandle

GetActiveActionSetLayerHandle(hInput as integer, index as integer) as integer

  • hInput - The handle of the input you want to get active action set layers for.
  • index - The index to get.

Gets the handle for an active action set layer for the given input by index.

Returns: The active action set layer handle.

Reference:
ISteamController#GetActiveActionSetLayers

GetActionSetHandle

GetActionSetHandle(actionSetName as string) as integer

  • actionSetName - The string identifier of an action set defined in the game's VDF file.

Lookup the handle for an Action Set. Best to do this once on startup, and store the handles for all future API calls.

Returns: The handle of the specified action set.

Reference:
ISteamController#GetActionSetHandle

GetAnalogActionData

GetAnalogActionData(hInput as integer, hAnalogAction as integer) as integer

  • hInput - The handle of the input you want to query.
  • hAnalogAction - The handle of the analog action you want to query.

Queries the analog action data for an input. Also returns whether or not this action is currently available to be bound in the active action set (the same as GetAnalogActionDataActive).

Returns: 1 if available; otherwise 0.

Reference:
ISteamController#GetAnalogActionData
ISteamController#ControllerAnalogActionData_t

GetAnalogActionDataActive

GetAnalogActionDataActive() as integer

Returns whether or not this action is currently available to be bound in the active action set as of the last GetAnalogActionData call.

Returns: 1 if available; otherwise 0.

Reference:
ISteamController#ControllerAnalogActionData_t

GetAnalogActionDataMode

GetAnalogActionDataMode() as integer

Returns the type of data coming from this action as of the last GetAnalogActionData call

Returns: The type of data coming from this action, this will match what was specified in the action set's VDF definition.

Reference:
ISteamController#ControllerAnalogActionData_t
ISteamController#EControllerSourceMode

GetAnalogActionDataX

GetAnalogActionDataX() as float

Returns the state of this action on the horizontal axis as of the last GetAnalogActionData call

Returns: The current state of this action on the horizontal axis.

Reference:
ISteamController#ControllerAnalogActionData_t

GetAnalogActionDataY

GetAnalogActionDataY() as float

Returns the state of this action on the vertical axis as of the last GetAnalogActionData call

Returns: The current state of this action on the vertical axis.

Reference:
ISteamController#ControllerAnalogActionData_t

GetAnalogActionHandle

GetAnalogActionHandle(actionName as string) as integer

  • actionName - The string identifier of the analog action defined in the game's VDF file.

Get the handle of the specified Analog action.

NOTE: This method does not take an action set handle parameter. That means that each action in your VDF file must have a unique string identifier. In other words, if you use an action called "up" in two different action sets, this method will only ever return one of them and the other will be ignored.

Returns: The analog action handle.

Reference:
ISteamController#GetAnalogActionHandle

GetAnalogActionOriginCount

GetAnalogActionOriginCount(hInput as integer, hActionSet as integer, hAnalogAction as integer) as integer

  • hInput - The handle of the input you want to query.
  • hActionSet - The handle of the action set you want to query.
  • hAnalogAction - The handle of the analog action you want to query.

Get the number of origins for an analog action within an action set.

Returns: The number of origins.

Reference:
ISteamController#GetAnalogActionOrigins

GetAnalogActionOriginValue

GetAnalogActionOriginValue(hInput as integer, hActionSet as integer, hAnalogAction as integer, index as integer) as integer

  • hInput - The handle of the input you want to query.
  • hActionSet - The handle of the action set you want to query.
  • hAnalogAction - The handle of the analog action you want to query.
  • index - The index of the origin.

Get the origin for an analog action within an action set by index. Use this to display the appropriate on-screen prompt for the action.

Returns: The origin.

Reference:
ISteamController#GetAnalogActionOrigins
ISteamController#EControllerActionOrigin

GetConnectedControllers

GetConnectedControllers() as integer

Enumerates currently connected controllers.

Must be called before controllers can be used because it loads the internal input handles.

Returns: The number of inputs found.

Reference:
ISteamController#GetConnectedControllers

GetControllerForGamepadIndex

GetControllerForGamepadIndex(index as integer) as integer

  • index - The index of the emulated gamepad you want to get an input handle for.

Returns the associated input handle for the specified emulated gamepad.

Returns: The associated input handle for the specified emulated gamepad.

Reference:
ISteamController#GetControllerForGamepadIndex

GetCurrentActionSet

GetCurrentActionSet(hInput as integer) as integer

  • hInput - The handle of the input you want to query.

Get the currently active action set for the specified input.

Returns: The handle of the action set activated for the specified input.

Reference:
ISteamController#GetCurrentActionSet

GetDigitalActionData

GetDigitalActionData(hInput as integer, hDigitalAction as integer) as integer

  • hInput - The handle of the input you want to query.
  • hDigitalAction - The handle of the digital action you want to query.

Queries the digital action data for an input. Also returns whether or not this action is currently available to be bound in the active action set (the same as GetDigitalActionDataActive).

Returns: 1 if this action is currently available; otherwise 0.

Reference:
ISteamController#GetDigitalActionData
ISteamController#ControllerDigitalActionData_t

GetDigitalActionDataActive

GetDigitalActionDataActive() as integer

Returns whether or not this action is currently available to be bound in the active action set.

Returns: 1 if this action is currently available; otherwise 0.

Reference:
ISteamController#GetDigitalActionData
ISteamController#ControllerDigitalActionData_t

GetDigitalActionDataState

GetDigitalActionDataState() as integer

Returns the current state of the digital game action read by the last GetDigitalActionData call.

Returns: The current state of this action; 1 if the action is currently pressed, otherwise 0.

Reference:
ISteamController#GetDigitalActionData
ISteamController#ControllerDigitalActionData_t

GetDigitalActionHandle

GetDigitalActionHandle(actionName as string) as integer

  • actionName - The string identifier of the digital action defined in the game's VDF file.

Get the handle of the specified digital action.

NOTE: This method does not take an action set handle parameter. That means that each action in your VDF file must have a unique string identifier. In other words, if you use an action called "up" in two different action sets, this method will only ever return one of them and the other will be ignored.

Returns: The handle of the specified digital action.

Reference:
ISteamController#GetDigitalActionHandle

GetDigitalActionOriginCount

GetDigitalActionOriginCount(hInput as integer, hActionSet as integer, hDigitalAction as integer) as integer

  • hInput - The handle of the input you want to query.
  • hActionSet - The handle of the action set you want to query.
  • hDigitalAction - The handle of the digital aciton you want to query.

Get the number of origins for a digital action within an action set.

Returns: A JSON integer array of the action origins.

Reference:
ISteamController#GetDigitalActionOrigins
ISteamController#EControllerActionOrigin

GetDigitalActionOriginValue

GetDigitalActionOriginValue(hInput as integer, hActionSet as integer, hDigitalAction as integer, index as integer) as integer

  • hInput - The handle of the input you want to query.
  • hActionSet - The handle of the action set you want to query.
  • hDigitalAction - The handle of the digital aciton you want to query.
  • index - The index of the origin.

Get the origin for a digital action within an action set by index. Use this to display the appropriate on-screen prompt for the action.

Returns: A JSON integer array of the action origins.

Reference:
ISteamController#GetDigitalActionOrigins
ISteamController#EControllerActionOrigin

GetGamepadIndexForController

GetGamepadIndexForController(hInput as integer) as integer

  • hInput - The handle of the input you want to get a gamepad index for.

Returns the associated gamepad index for the specified input, if emulating a gamepad.

Returns: An integer.

Reference:
ISteamController#GetGamepadIndexForController

GetGlyphForActionOrigin

GetGlyphForActionOrigin(eOrigin as integer) as string

  • eOrigin - The origin you want to get the glyph for.

Get a local path to art for on-screen glyph for a particular origin.

Returns: The path to the png file for the glyph.

Reference:
ISteamController#GetGlyphForActionOrigin

GetInputTypeForHandle

GetInputTypeForHandle(hInput as integer) as integer

  • hInput - The handle of the input.

Returns the input type (device model) for the specified input. This tells you if a given input is a Steam controller, XBox 360 controller, PS4 controller, etc.

Returns: Returns the input type (device model) for the specified input.

Reference:
ISteamController#GetInputTypeForHandle

GetMotionData

GetMotionData(hInput as integer)

  • hInput - The handle of the input you want to get motion data for.

Reads the raw motion data for the specified input;

Reference:
ISteamController#GetDigitalActionData
ISteamController#ControllerDigitalActionData_t

GetMotionDataPosAccelX

GetMotionDataPosAccelX() as float

Returns the positional acceleration, x axis for the last GetMotionData call.

Returns: Positional acceleration, x axis.

Reference:
ISteamController#ControllerDigitalActionData_t

GetMotionDataPosAccelY

GetMotionDataPosAccelY() as float

Returns the positional acceleration, y axis for the last GetMotionData call

Returns: Positional acceleration, y axis.

Reference:
ISteamController#ControllerDigitalActionData_t

GetMotionDataPosAccelZ

GetMotionDataPosAccelZ() as float

Returns the positional acceleration, z axis for the last GetMotionData call

Returns: Positional acceleration, z axis.

Reference:
ISteamController#ControllerDigitalActionData_t

GetMotionDataRotQuatW

GetMotionDataRotQuatW() as float

Returns the sensor-fused absolute rotation (will drift in heading), w axis for the last GetMotionData call GetMotionData MUST be called in order to populate the value returned by this method.

Returns: Sensor-fused absolute rotation (will drift in heading), w axis.

Reference:
ISteamController#ControllerDigitalActionData_t

GetMotionDataRotQuatX

GetMotionDataRotQuatX() as float

Returns the sensor-fused absolute rotation (will drift in heading), x axis for the last GetMotionData call

Returns: Sensor-fused absolute rotation (will drift in heading), x axis.

Reference:
ISteamController#ControllerDigitalActionData_t

GetMotionDataRotQuatY

GetMotionDataRotQuatY() as float

Returns the sensor-fused absolute rotation (will drift in heading), y axis for the last GetMotionData call

Returns: Sensor-fused absolute rotation (will drift in heading), y axis.

Reference:
ISteamController#ControllerDigitalActionData_t

GetMotionDataRotQuatZ

GetMotionDataRotQuatZ() as float

Returns the sensor-fused absolute rotation (will drift in heading), z axis for the last GetMotionData call

Returns: Sensor-fused absolute rotation (will drift in heading), z axis.

Reference:
ISteamController#ControllerDigitalActionData_t

GetMotionDataRotVelX

GetMotionDataRotVelX() as float

Returns the angular velocity, x axis for the last GetMotionData call

Returns: Angular velocity, x axis.

Reference:
ISteamController#ControllerDigitalActionData_t

GetMotionDataRotVelY

GetMotionDataRotVelY() as float

Returns the angular velocity, y axis for the last GetMotionData call

Returns: Angular velocity, y axis.

Reference:
ISteamController#ControllerDigitalActionData_t

GetMotionDataRotVelZ

GetMotionDataRotVelZ() as float

Returns the angular velocity, z axis for the last GetMotionData call

Returns: Angular velocity, z axis.

Reference:
ISteamController#ControllerDigitalActionData_t

GetStringForActionOrigin

GetStringForActionOrigin(eOrigin as integer) as string

  • eOrigin - The origin you want to get the string for.

Returns a localized string (from Steam's language setting) for the specified origin.

Returns: The localized string for the specified origin.

Reference:
ISteamController#GetStringForActionOrigin
ISteamController#EControllerActionOrigin

InitSteamInput

InitSteamInput() as integer

Must be called when starting use of the ISteamInput interface.

Returns: Always 1 if the Steam plugin has been initialized; otherwise 0.

Reference:
ISteamController#Init

RunFrame

RunFrame()

Synchronize API state with the latest Steam Input inputs available. This is performed automatically by RunCallbacks, but for the absolute lowest possible latency, you can call this directly before reading input state.

Reference:
ISteamController#RunFrame

SetInputLEDColor

SetInputLEDColor(hInput as integer, red as integer, green as integer, blue as integer)

  • hInput - The handle of the input to affect.
  • red - The red component of the color to set (0-255).
  • green - The green component of the color to set (0-255).
  • blue - The blue component of the color to set (0-255).

Set the input LED color on supported inputs.

Reference:
ISteamController#SetLEDColor
ISteamController#ESteamControllerLEDFlag

ResetInputLEDColor

ResetInputLEDColor(hInput as integer)

  • hInput - The handle of the input to affect.

Set the input LED color back to the default (out-of-game) settings.

Reference:
ISteamController#SetLEDColor
ISteamController#ESteamControllerLEDFlag

ShowBindingPanel

ShowBindingPanel(hInput as integer) as integer

  • hInput - The handle of the input you want to bring up the binding screen for.

Invokes the Steam overlay and brings up the binding screen.

Returns: 1 for success; 0 if overlay is disabled/unavailable, or the user is not in Big Picture Mode.

Reference:
ISteamController#ShowBindingPanel

ShutdownSteamInput

ShutdownSteamInput() as integer

Must be called when ending use of the Steam Input interface.

This is called within Shutdown and also while unloading the plugin, so calling it explictly should not be necessary.

Returns: Always 1 if the Steam plugin has been initialized; otherwise 0.

Reference:
ISteamController#Shutdown

StopAnalogActionMomentum

StopAnalogActionMomentum(hInput as integer, hAnalogAction as integer)

  • hInput - The handle of the input to affect.
  • hAnalogAction - The analog action handle to stop momentum for.

Stops the momentum of an analog action (where applicable, ie a touchpad w/ virtual trackball settings).

Reference:
ISteamController#StopAnalogActionMomentum

TriggerInputHapticPulse

TriggerInputHapticPulse(hInput as integer, eTargetPad as integer, duration as integer)

  • hInput - The handle of the input to affect.
  • eTargetPad - Which haptic touch pad to affect.
  • duration - Duration of the pulse, in microseconds (1/1,000,000th of a second)

Triggers a (low-level) haptic pulse on supported inputs.

NOTES Currently only the VSC supports haptic pulses. This API call will be ignored for all other input models.

Reference:
ISteamController#TriggerHapticPulse

TriggerInputRepeatedHapticPulse

TriggerInputRepeatedHapticPulse(hInput as integer, eTargetPad as integer, onDuration as integer, offDuration as integer, repeat as integer)

  • hInput - The handle of the input to affect.
  • eTargetPad - Which haptic touch pad to affect.
  • onDuration - Duration of the pulse, in microseconds (1/1,000,000th of a second).
  • offDuration - Duration of the pause between pulses, in microseconds.
  • repeat - Number of times to repeat the onDuration / offDuration duty cycle.

Triggers a repeated haptic pulse on supported inputs.

NOTES Currently only the VSC supports haptic pulses. This API call will be ignored for incompatible input models. This is a more user-friendly function to call than TriggerHapticPulse as it can generate pulse patterns long enough to be actually noticed by the user.

Reference:
ISteamController#TriggerRepeatedHapticPulse

TriggerInputVibration

TriggerInputVibration(hInput as integer, leftSpeed as integer, rightSpeed as integer)

  • hInput - The handle of the input to affect.
  • leftSpeed - The period of the left rumble motor's vibration, in microseconds.
  • rightSpeed - The period of the right rumble motor's vibration, in microseconds.

Trigger a vibration event on supported inputs.

This API call will be ignored for incompatible input models.

Reference:
ISteamController#TriggerVibration

GetActionOriginFromXboxOrigin

GetActionOriginFromXboxOrigin(hInput as integer, eOrigin as integer) as integer

  • hInput - The handle of the input you want to query.
  • eOrigin - The Xbox controller origin.

Get the equivalent ActionOrigin for a given Xbox controller origin. This can be chained with GetGlyphForActionOrigin to provide future proof glyphs for non-Steam Input API action games.

Note - this only translates the buttons directly and doesn't take into account any remapping a user has made in their configuration

Returns: The ActionOrigin for a given Xbox controller origin.

Reference:
ISteamInput#GetActionOriginFromXboxOrigin
ISteamInput#EInputActionOrigin

GetStringForXboxOrigin

GetStringForXboxOrigin(eOrigin as integer) as string

  • eOrigin - The Xbox controller origin.

Returns a localized string (from Steam's language setting) for the specified Xbox controller origin.

Returns: The localized string for the specified Xbox controller origin.

Reference:
ISteamInput#GetStringForXboxOrigin

GetGlyphForXboxOrigin

GetGlyphForXboxOrigin(eOrigin as integer) as string

  • eOrigin - The Xbox controller origin.

Returns the local path to art for the on-screen glyph for a particular Xbox controller origin.

Returns: The path to art for the on-screen glyph for a particular Xbox controller origin.

Reference:
ISteamInput#GetGlyphForXboxOrigin

TranslateActionOrigin

TranslateActionOrigin(eDestinationInputType as integer, eSourceOrigin as integer) as integer

  • eDestinationInputType - The input type to convert from.
  • eSourceOrigin - The action origin to convert from.

Convert an origin to another controller type.

Returns: The action origin for the destination input type.

Reference:
ISteamInput#TranslateActionOrigin
ISteamInput#EInputActionOrigin

GetDeviceBindingRevisionMajor

GetDeviceBindingRevisionMajor(hInput as integer) as integer

  • hInput - The handle of the input you want to query.

Gets the major device binding revisions for Steam Input API configurations.

Returns: The major revision value or -1 if the binding is still loading.

Reference:
ISteamInput#GetDeviceBindingRevision

GetDeviceBindingRevisionMinor

GetDeviceBindingRevisionMinor(hInput as integer) as integer

  • hInput - The handle of the input you want to query.

Gets the minor device binding revisions for Steam Input API configurations.

Returns: The minor revision value or -1 if the binding is still loading.

Reference:
ISteamInput#GetDeviceBindingRevision

GetRemotePlaySessionID

GetRemotePlaySessionID(hInput as integer) as integer

  • hInput - The handle of the input you want to query.

Get the Steam Remote Play session ID associated with a device, or 0 if there is no session associated with it.

Returns: The Steam Remote Play session ID or 0.

Reference:
ISteamInput#GetRemotePlaySessionID