Previous
mux
Configuring a webgamepad
input controller allows you to use a web-based gamepad as a device to communicate with your machine.
You must use “WebGamepad” as the name
of the web gamepad controller.
This restriction will be removed in the future.
To be able to test your gamepad as you configure it, physically connect your gamepad to your machine’s computer and turn both on. Then, configure the controller.
Use the following configuration for an input controller of model webgamepad
:
Navigate to the CONFIGURE tab of your machine’s page in the Viam app.
Click the + icon next to your machine part in the left-hand menu and select Component.
Select the input_controller
type, then select the webgamepad
model.
Enter the name WebGamepad
and click Create.
{
"components": [
{
"name": "WebGamepad",
"model": "webgamepad",
"type": "input_controller",
"namespace": "rdk",
"attributes": {},
"depends_on": []
}
]
}
After you configure your input controller, open the input controller’s TEST panel on the CONFIGURE or CONTROL tabs. View the current value of each input on your controller.
You have to press a button or move a stick on your gamepad for the browser to report the gamepad. For your security, the browser won’t report a gamepad until an input has been sent.
If your input controller is not working as expected, follow these steps:
If none of these steps work, reach out to us on the Community Discord and we will be happy to help.
For more configuration and usage info, see:
Was this page helpful?
Glad to hear it! If you have any other feedback please let us know:
We're sorry about that. To help us improve, please tell us what we can do better:
Thank you!