Configure a mux input controller

Configuring a mux (multiplexed) input controller allows you to combine one or more controllers into a single virtual controller.

This lets you control a robot from different locations, such as the web and a locally connected gamepad, or use multiple controllers as one device.

For example, you could use a joystick alongside a numpad.

Configuration

To combine multiple controlers into a mux controller, you must first configure each controller individually.

The following example configuration combines a gamepad and a webgamepad controller:

What configuration for a multiplexed input controller component looks like in the Viam App config builder.
{
  "components": [
    {
      "name": <your-mux-input-controller>,
      "type": "input_controller",
      "model": "mux",
      "attributes": {
        "sources": [
          <your-gamepad-input-controller,
          "WebGamepad"
        ]
      },
      "depends_on": [
        <your-gamepad-input-controller>,
        "WebGamepad"
      ]
    },
    {
      "name": <your-gamepad-input-controller>,
      "type": "input_controller",
      "model": "gamepad",
      "attributes": {
        "dev_file": "",
        "auto_reconnect": false
      },
      "depends_on": []
    },
    {
      "name": "WebGamepad",
      "type": "input_controller",
      "model": "webgamepad",
      "attributes": {},
      "depends_on": []
    }
  ]
}

The following attributes are available for mux input controllers:

NameInclusionDescription
sourcesRequiredAn array of names of each input controller component that should be combined in the mux model.

Troubleshooting

You can find additional assistance in the Troubleshooting section.

You can also ask questions in the Community Discord and we will be happy to help.