From 0408f29c3a5b1d61f3079506c0d9a3ba5f7d1ac3 Mon Sep 17 00:00:00 2001 From: Bradley Needham Date: Wed, 29 Mar 2023 08:40:57 -0700 Subject: [PATCH] Add multitouch support to Gamepad API Changes and updates have been made to Fernando Attia's patchset 1612050. The implementation has been changed to support the most recent changes to the spec https://github.com/w3c/gamepad/pull/168. Support for DualShock4 controller is part of patch. This commit is a squash of several changes the last major one is: Normalize touchIds per Gamepad The same hardware may provide input to Gamepads in different tabs. This commit normalizes touchIds coming from the hardware to a single incremented value starting at zero per Gamepad instance. Extend the Gamepad API to support multitouch surfaces (touchpads). Intent to prototype : https://groups.google.com/a/chromium.org/g/blink-dev/c/4q_k23rPMos Chrome status entry: https://www.chromestatus.com/feature/4782975812108288 R=mattreynolds@chromium.org Change-Id: I0fa2006c3fc36a908b316cc29b97d295aac798ca Update idl to match current spec draft Normalize touchid to 32bit value. Update web tests. Bug: 1143942 Change-Id: I80ed31ebf0c6a347906b91b3c178099d1e332c53 --- resources/chromium/webxr-test.js | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/chromium/webxr-test.js b/resources/chromium/webxr-test.js index 679343764a01c5..ab2c6faa0ee84b 100644 --- a/resources/chromium/webxr-test.js +++ b/resources/chromium/webxr-test.js @@ -1966,6 +1966,7 @@ class MockXRInputSource { timestamp: 0n, axes: [], buttons: [], + touchEvents: [], mapping: GamepadMapping.GamepadMappingStandard, displayId: 0, };