mux

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

This lets you control a machine 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 controllers into a mux controller, you must first configure each controller individually.

{
  "components": [
    {
      "name": "<your-mux-input-controller-name>",
      "model": "mux",
      "api": "rdk:component:input_controller",
      "attributes": {
        "sources": [
          "<your-gamepad-input-controller-name",
          "<your-other-gamepad-input-controller-name>"
        ]
      },
      "depends_on": [
        "<your-gamepad-input-controller-name>",
        "<your-other-gamepad-input-controller-name>"
      ]
    }
    <...CONFIGS FOR THE INDIVIDUAL INPUT CONTROLLERS...>
  ]
}

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

{
  "components": [
    {
      "name": "my-combined-controller",
      "model": "mux",
      "api": "rdk:component:input_controller",
      "attributes": {
        "sources": ["myGamepad", "WebGamepad"]
      },
      "depends_on": ["myGamepad", "WebGamepad"]
    },
    {
      "name": "myGamepad",
      "model": "gamepad",
      "api": "rdk:component:input_controller",
      "attributes": {
        "auto_reconnect": true
      },
      "depends_on": []
    },
    {
      "name": "WebGamepad",
      "model": "webgamepad",
      "api": "rdk:component:input_controller",
      "attributes": {},
      "depends_on": []
    }
  ]
}

The following attributes are available for mux input controllers:

NameTypeRequired?Description
sourcesarrayRequiredThe name of every controller component you wish to combine input from.

Test the input controller

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.

The input controller component in the test panel.