[Webkit-unassigned] [Bug 206033] Standard gamepad mapping for GameControllerGamepads

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jan 13 17:51:51 PST 2020


https://bugs.webkit.org/show_bug.cgi?id=206033

--- Comment #8 from James Howard <jameshoward at mac.com> ---
> Also, it seems you added the mapping field, but we only support the canonical standard mapping. 

There are two supported mappings, "" and "standard" [1]. Prior to my patch, WebKit only offered the empty string mapping. After my patch, we continue to provide empty string mapping for gamepads whose physical layout we're either unaware of, or that don't correspond to the standard layout (HID gamepads on Mac, micro gamepads on iOS). For now, I'm just providing the standard mapping for the GCExtendedGamepads, because it's very straightforward.

As for what we should do for Mac, we could start recognizing certain vendor / product ID tuples in HIDGamepad and do the standard mapping for them. We'd end up having to bundle some sort of database of these controllers, similar to what SDL does for instance. The other alternative would be to make GameController the preferred API for gamepads on macOS 10.15+ and move off of the HIDGamepad implementation. Personally, I like the simplicity of using GameController.framework as it pushes the controller database issue off to them and unifies the code between iOS and Mac. I'm happy to contribute either approach in a follow-up patch if you have a stance on which approach you'd like to see.

> Do we plan to add labels for the types of controllers we do support?

I'm not sure what you mean. Gamepads have an id field, which is just a string identifier. With GameController.framework examples of these are "Nimbus Extended Gamepad" or "Xbox Wireless Controller Extended Gamepad". I didn't change that in this patch. In terms of the mapping, there are currently just two in the spec: "" and "standard" [1].

[1] https://w3c.github.io/gamepad/#gamepadmappingtype-enum

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200114/2db46926/attachment-0001.htm>


More information about the webkit-unassigned mailing list