GamepadSupports
For thread safety, this property is not safe to read in an unsynchronized thread.
This function returns whether the given Enum/UserInputType gamepad supports a button corresponding with the given Enum//KeyCode. This function is used to determine valid gamepad inputs.
To determine which Enum/UserInputType gamepads are connected, use UserInputService/GetConnectedGamepads.
As UserInputService is client-side only, this function can only be used in a LocalScript.
See this page for articles on cross-platform development.
See also
UserInputService/GamepadConnectedUserInputService/GamepadDisconnectedUserInputService/GetConnectedGamepadsUserInputService/GetNavigationGamepadsUserInputService/SetNavigationGamepadUserInputService/IsNavigationGamepadUserInputService/IsGamepadButtonDownUserInputService/GetSupportedGamepadKeyCodesUserInputService/GetGamepadStateUserInputService/GetGamepadConnectedUserInputService/GamepadEnabled
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
|
|
The |
||
|
|
The |
Returns
| Return Type | Summary |
|---|---|
|
Whether the given gamepad supports a button corresponding with the given |
Code Samples
Binding Functions to Gamepad Controls
This example binds the Enum/KeyCode|ButtonX key to action if it is supported by controller (Enum/UserInputType|Gamepad1). If bound, pressing the X Button invokes the action() function, which prints “Action”.