Bug 266293
Summary: | Gamepad: Map DualShock/DualSense Trackpad Button | ||
---|---|---|---|
Product: | WebKit | Reporter: | James Howard <jameshoward> |
Component: | WebCore Misc. | Assignee: | Byungseon(Sun) Shin <sun.shin> |
Status: | NEW | ||
Severity: | Normal | CC: | beidson, jameshoward, karlcow, marcosc, sun.shin, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | Safari Technology Preview | ||
Hardware: | All | ||
OS: | All |
James Howard
On Sony gamepads, the trackpad is itself a clickable button. This is independent of the multitouch behavior of the trackpad[^1]. Chromium maps this trackpad click as button 17 in the standard gamepad mapping.
In WebKit, the trackpad button is unmapped[^2].
I notice that the Gamepad spec[^3] now says that user agents can choose to map exactly the 16 buttons regardless of what the controller supports as a fingerprinting mitigation, so maybe it makes sense to get button 17 added to the spec as part of the standard mapping, or else always make the buttons array be 17 elements long for all controller types.
Steps to reproduce:
1. Connect a Sony DualShock 4 or Sony DualSense controller via USB or BT.
2. Navigate to https://gamepad-tester.com
3. Press any button on controller to get page to recognize it.
4. Press the trackpad button.
Results:
Safari Technology Preview 184, macOS 14.1.1: Nothing happens.
Chrome 120.0.6099.71, macOS 14.1.1: Button 17 value toggles between 0.0 and 1.0 when pressed.
Why do we want this:
Some games make use of the trackpad button.
[^1]: https://knyg.github.io/gamepad/extensions.html#gamepadtouch-interface
[^2]: https://github.com/WebKit/WebKit/blob/ed54b0254b83b2ea15aa23354e1e0c91f1d8dfaf/Source/WebCore/platform/gamepad/cocoa/GameControllerGamepad.mm#L57
[^3]: https://w3c.github.io/gamepad/#fingerprinting-mitigation
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Marcos Caceres
James, would you mind filing a bug on the spec?
https://github.com/w3c/gamepad/issues
Sounds like we need to update the spec in parallel.
Marcos Caceres
Filed spec issue https://github.com/w3c/gamepad/issues/191
James Howard
Thanks for doing that for me, Marcos :)
Radar WebKit Bug Importer
<rdar://problem/119876782>
Byungseon(Sun) Shin
Will work on by the W3C working group proposal.
- https://github.com/w3c/gamepad/pull/196