ISteamInput

Function Reference

input.init()

Must be called when starting use of the ISteamInput interface.

Returns:(boolean) Always returns true.
SteamWorks:Init
input.shutdown()

Must be called when ending use of the ISteamInput interface.

Returns:(boolean) Always returns true.
SteamWorks:Shutdown
input.activateActionSet()
Parameters:
  • inputHandle (uint64) – The handle of the controller you want to activate an action set for. Alternatively, pass the string “all” to activate all the controllers at once. Obtained from input.getConnectedControllers().
  • actionSetHandle (uint64) – The handle of the action set you want to activate. Obtained from input.getActionSetHandle().
Returns:

nothing

SteamWorks:

ActivateActionSet

input.activateActionSetLayer()
Parameters:
Returns:

nothing

SteamWorks:

ActivateActionSetLayer

input.deactivateActionSetLayer()
Parameters:
Returns:

nothing

SteamWorks:

DeactivateActionSetLayer

input.deactivateAllActionSetLayers()
Parameters:inputHandle (uint64) – The handle of the controller you want to deactivate all action set layers for. Obtained from input.getConnectedControllers().
Returns:nothing
SteamWorks:DeactivateAllActionSetLayers
input.getActiveActionSetLayers()
Parameters:inputHandle (uint64) – The handle of the controller you want to get active action set layers for. Obtained from input.getConnectedControllers().
Returns:(table) An array of InputActionSetHandle (more precisely, uint64) with all of the currently active action set layers for a specified controller handle.
SteamWorks:GetActiveActionSetLayers
input.getActionSetHandle()
Parameters:actionSetName (string) – The string identifier of an action set defined in the game’s VDF file.
Returns:(number) The handle (InputActionSetHandle, ie uint64) of the specified action set.
SteamWorks:GetActionSetHandle
input.getAnalogActionData()
Parameters:
Returns:

(table) A table with fields filled with InputAnalogActionData; see InputAnalogActionData_t

SteamWorks:

GetAnalogActionData

input.getAnalogActionHandle()
Parameters:actionName (string) – The string identifier of the analog action defined in the game’s VDF file.
Returns:(number) The handle (InputAnalogActionHandle, ie uint64) of the specified analog action.
SteamWorks:GetAnalogActionHandle
input.getAnalogActionOrigins()
Parameters:
Returns:

(table) An array filled with origins (EInputActionOrigin, ie string; see EInputActionOrigin) for an analog action within an action set. Use this to display the appropriate on-screen prompt for the action.

SteamWorks:

GetAnalogActionOrigins

input.getConnectedControllers()
Returns:(table) An array filled with the inputHandles (uint64) of currently connected controllers.
SteamWorks:GetConnectedControllers
input.getControllerForGamepadIndex()
Parameters:index (int) – The index of the emulated gamepad you want to get a controller handle for.
Returns:(number) The inputHandle (uint64) of the associated controller handle for the specified emulated gamepad. Can be used with GetInputTypeForHandle to determine the controller type of a controller using Steam Input Gamepad Emulation.
SteamWorks:GetControllerForGamepadIndex
input.getCurrentActionSet()
Parameters:inputHandle (uint64) – The handle of the controller you want to query. Obtained from input.getConnectedControllers().
Returns:(number) The InputActionSetHandle (uint64) handle of the action set activated for the specified controller.
SteamWorks:GetCurrentActionSet
input.getDigitalActionData()
Parameters:
Returns:

(table) The current state (InputDigitalActionData, see InputDigitalActionData_t) of the supplied digital game action.

SteamWorks:

GetDigitalActionData

input.getDigitalActionHandle()
Parameters:actionName (string) – The string identifier of the digital action defined in the game’s VDF file.
Returns:(number) The handle (InputDigitalActionHandle, ie uint64) of the specified digital action.
SteamWorks:GetDigitalActionHandle
input.getDigitalActionOrigins()
Parameters:
Returns:

(table) An array filled with origins (EInputActionOrigin, ie string; see EInputActionOrigin) for an input.getDigitalActionHandle() action within an action set. Use this to display the appropriate on-screen prompt for the action.

SteamWorks:

GetDigitalActionOrigins

input.getGamepadIndexForController()
Parameters:inputHandle (uint64) – The handle of the controller you want to get a gamepad index for. Obtained from input.getConnectedControllers().
Returns:(number) The associated gamepad index for the specified controller, if emulating a gamepad.
SteamWorks:GetGamepadIndexForController
input.getGlyphForActionOrigin()
Parameters:origin (string) –

For example, LeftStick_Click, X, B. See EInputActionOrigin for reference.

Returns:(string) A local path to art for on-screen glyph for a particular origin.
SteamWorks:GetGlyphForActionOrigin
input.getInputTypeForHandle()
Parameters:inputHandle (uint64) – The handle of the controller whose input type (device model) you want to query. Obtained from input.getConnectedControllers().
Returns:(string) The input type (device model; see ESteamInputType) for the specified controller. This tells you if a given controller is a Steam controller, XBox 360 controller, PS4 controller, etc.
SteamWorks:GetInputTypeForHandle
input.getMotionData()
Parameters:inputHandle (uint64) – The handle of the controller you want to get motion data for. Obtained from input.getConnectedControllers().
Returns:(table) A table (see InputMotionData_t) filled with raw motion data for the specified controller.
SteamWorks:GetMotionData
input.getStringForActionOrigin()
Parameters:origin (string) –

For example, LeftStick_Click, X, B. See EInputActionOrigin for reference.

Returns:(string) Returns a localized string (from Steam’s language setting) for the specified origin.
SteamWorks:GetStringForActionOrigin
input.runFrame()

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

Returns:nothing
SteamWorks:RunFrame
input.setLEDColor()
Parameters:
  • inputHandle (uint64) – The handle of the controller to affect. Obtained from input.getConnectedControllers().
  • colorR (uint8) – The red component of the color to set (0-255).
  • colorG (uint8) – The green component of the color to set (0-255).
  • colorB (uint8) – The blue component of the color to set (0-255).
  • resetColor (boolean) – If true, restores the color to default (out-of-game) settings. Otherwise, set to the presented RGB color.
Returns:

nothing

SteamWorks:

SetLEDColor

input.showBindingPanel()
Parameters:inputHandle (uint64) – The handle of the controller you want to bring up the binding screen for. Obtained from input.getConnectedControllers().
Returns:(boolean) true for success; false if overlay is disabled/unavailable, or the user is not in Big Picture Mode.
SteamWorks:ShowBindingPanel
input.stopAnalogActionMomentum()
Parameters:
Returns:

nothing

SteamWorks:

StopAnalogActionMomentum

input.triggerHapticPulse()
Parameters:
  • inputHandle (uint64) – The handle of the controller to affect. Obtained from input.getConnectedControllers().
  • targetPad (string) – Left or Right depending on which haptic touch pad to affect. See ESteamControllerPad.
  • usDurationMicroSec (short) – Duration of the pulse, in microseconds (1/1,000,000th of a second)
Returns:

nothing

SteamWorks:

TriggerHapticPulse

input.triggerRepeatedHapticPulse()
Parameters:
  • inputHandle (uint64) – The handle of the controller to affect. Obtained from input.getConnectedControllers().
  • targetPad (string) –

    Left or Right depending on which haptic touch pad to affect. See ESteamControllerPad.

  • usDurationMicroSec (short) – Duration of the pulse, in microseconds (1/1,000,000th of a second)
  • usOffMicroSec (short) – Duration of the pause between pulses, in microseconds.
  • unRepeat (short) – Number of times to repeat the usDurationMicroSec / usOffMicroSec duty cycle.
Returns:

nothing

SteamWorks:

TriggerRepeatedHapticPulse

input.triggerVibration()
Parameters:
  • inputHandle (uint64) – The handle of the controller to affect. Obtained from input.getConnectedControllers().
  • usLeftSpeed (short) – The intensity value for the left rumble motor.
  • usRightSpeed (short) – The intensity value for the right rumble motor.
Returns:

nothing

SteamWorks:

TriggerVibration

input.getActionOriginFromXboxOrigin()
Parameters:
Returns:

nothing

SteamWorks:

GetActionOriginFromXboxOrigin

input.translateActionOrigin()
Parameters:
Returns:

(string) The equivalent origin (EInputActionOrigin) for a given controller type or the closest controller type that existed in the SDK you built into your game if eDestinationInputType is Unknown. This action origin can be used in your glyph look up table or passed into input.getGlyphForActionOrigin() or input.getStringForActionOrigin().

SteamWorks:

TranslateActionOrigin

input.getDeviceBindingRevision()
Parameters:inputHandle (uint64) – The handle of the controller to query. Obtained from input.getConnectedControllers().
Returns:(boolean) Returns true if a device binding was successfully found and false if the binding is still loading
Returns:(number?) If call was successful, returns the major binding revision for Steam Input API configurations.
Returns:(number?) If call was successful, returns the minor binding revision for Steam Input API configurations.
SteamWorks:GetDeviceBindingRevision
input.getRemotePlaySessionID()
Parameters:inputHandle (uint64) – The handle of the controller to query. Obtained from input.getConnectedControllers().
Returns:(number) Steam Remote Play session ID
SteamWorks:GetRemotePlaySessionID