ISteamInput¶
List of Functions¶
Function Reference¶
- input.init()¶
Must be called when starting use of the ISteamInput interface.
- Parameters:
explicitlyCallRunFrame (boolean) – If true, you will need to manually call input.runFrame() each frame, otherwise Steam Input will call it automatically when Steam.runCallbacks() is called.
- Returns:
(boolean) Always returns true.
- SteamWorks:
- input.shutdown()¶
Must be called when ending use of the ISteamInput interface.
- Returns:
(boolean) Always returns true.
- SteamWorks:
- 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:
- input.activateActionSetLayer()¶
- Parameters:
inputHandle (uint64) – The handle of the controller you want to activate an action set layer for. Obtained from
input.getConnectedControllers()
.actionSetLayerHandle (uint64) – The handle of the action set layer you want to activate. Obtained from
input.getActiveActionSetLayers()
.
- Returns:
nothing
- SteamWorks:
- input.deactivateActionSetLayer()¶
- Parameters:
inputHandle (uint64) – The handle of the controller you want to deactivate an action set layer for. Obtained from
input.getConnectedControllers()
.actionSetLayerHandle (uint64) – The handle of the action set layer you want to deactivate. Obtained from
input.getActiveActionSetLayers()
.
- Returns:
nothing
- SteamWorks:
- 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:
- 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:
- 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:
- input.getAnalogActionData()¶
- Parameters:
inputHandle (uint64) – The handle of the controller you want to query. Obtained from
input.getConnectedControllers()
.analogActionHandle (uint64) – A handle to an analog action. This can be obtained from
input.getAnalogActionHandle()
.
- Returns:
(table) A table with fields filled with InputAnalogActionData; see InputAnalogActionData_t
- SteamWorks:
- 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:
- input.getAnalogActionOrigins()¶
- Parameters:
inputHandle (uint64) – The handle of the controller you want to query. Obtained from
input.getConnectedControllers()
.actionSetHandle (uint64) – The handle of the action set you want to query. This can be obtained from
input.getActionSetHandle()
.analogActionHandle (uint64) – The handle of the analog action you want to query. This can be obtained from
input.getAnalogActionHandle()
.
- 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:
- input.getConnectedControllers()¶
- Returns:
(table) An array filled with the inputHandles (uint64) of currently connected controllers.
- SteamWorks:
- 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:
- 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:
- input.getDigitalActionData()¶
- Parameters:
inputHandle (uint64) – The handle of the controller you want to query. Obtained from
input.getConnectedControllers()
.digitalActionHandle (uint64) – The handle of the controller you want to query. This can be obtained from
input.getDigitalActionHandle()
.
- Returns:
(table) The current state (InputDigitalActionData, see InputDigitalActionData_t) of the supplied digital game action.
- SteamWorks:
- 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:
- input.getDigitalActionOrigins()¶
- Parameters:
inputHandle (uint64) – The handle of the controller you want to query. Obtained from
input.getConnectedControllers()
.actionSetHandle (uint64) – The handle of the action set you want to query. This can be obtained from
input.getActionSetHandle()
.digitalActionHandle (uint64) – The handle of the digital action you want to query. This can be obtained from
input.getDigitalActionHandle()
.
- 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:
- 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:
- input.getGlyphForActionOrigin_Legacy()¶
- 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:
- 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:
- 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:
- 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:
- 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:
- 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:
- 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:
- input.stopAnalogActionMomentum()¶
- Parameters:
inputHandle (uint64) – The handle of the controller to affect. Obtained from
input.getConnectedControllers()
.action (uint64) – The analog action to stop momentum for. This can be obtained from
input.getAnalogActionHandle()
.
- Returns:
nothing
- SteamWorks:
- input.legacy_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:
- input.legacy_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:
- 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:
- input.getActionOriginFromXboxOrigin()¶
- Parameters:
inputHandle (uint64) – The handle of the controller to affect. Obtained from
input.getConnectedControllers()
, or frominput.getControllerForGamepadIndex()
.origin (string) –
This is the button you want to get the image for example: A, B, LeftTrigger_Click, LeftStick_DPadWest. See EInputActionOrigin for reference.
- Returns:
nothing
- SteamWorks:
- input.translateActionOrigin()¶
- Parameters:
inputHandle (uint64) – The handle of the controller to affect. Obtained from
input.getConnectedControllers()
, or frominput.getControllerForGamepadIndex()
.destinationInputType (string) –
The controller type (see ESteamInputType) you want to translate to.
sourceOrigin (string) –
This is the button you want to translate. For example, LeftStick_Click, X, B. See EInputActionOrigin for all options.
- 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()
orinput.getStringForActionOrigin()
.- SteamWorks:
- 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:
- input.getRemotePlaySessionID()¶
- Parameters:
inputHandle (uint64) – The handle of the controller to query. Obtained from
input.getConnectedControllers()
.- Returns:
(number) Steam Remote Play session ID
- SteamWorks: