Re: [w3c/gamepad] Interop 2025 investigation effort - Gamepad API testing (Issue #219)

sadym-chromium left a comment (w3c/gamepad#219)

Proposed WebDriver BiDi API:

#### Connect gamepad
```
{
  method: "emulation.simulateDevice",
  params: {
    type: "gamepad",
    context: text,
    gamepad: {
      id: string,
      index: number,
      mapping: "" / "standard" / "xr-standard",
      effects: [ ("dual-rumble", "trigger-rumble") ]
    }
  }
}
Returns
{
  deviceId: UUID,
}
```

#### Disconnect gamepad
```
{
  method: "emulation.disableSimulation",
  params: {
    deviceId: UUID,
  }
}
Returns {}
```

#### Input emulation
Extend WebDriver BiDi [`input.performActions`](https://www.w3.org/TR/webdriver-bidi/#command-input-performActions):
```
input.GamepadSourceActions = {
  type: "gamepad",
  id: text,
  actions: [*input.WheelSourceAction]
}

input.GamepadSourceAction = (
  input.PauseAction /
  input.GamepadAxisAction /
  input.GamepadButtonAction /
  input.GamepadTouchAction
)
```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/gamepad/issues/219#issuecomment-2769266946
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/gamepad/issues/219/2769266946@github.com>

Received on Tuesday, 1 April 2025 12:55:18 UTC