[Webkit-unassigned] [Bug 206033] Standard gamepad mapping for GameControllerGamepads
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Jan 13 17:33:08 PST 2020
https://bugs.webkit.org/show_bug.cgi?id=206033
--- Comment #7 from James Howard <jameshoward at mac.com> ---
Hey dino! Thanks for the review! I've attached an updated patch incorporating your feedback.
A couple of notes:
> For example, I see you swapped some axis mappings. Was that a bug?
I updated the changelog entry to cover this, but in brief, when using the empty string gamepad mapping, anything goes in terms of axis coordinate systems. When using the "standard" mapping, however, the expectation is that the Y axis is treated as -1 = up, 1 = down [1], which is flipped from what GCControllerAxisInput provides.
> rationale for including the home button
My initial rationale was that the button exists on popular gamepads, the "standard" mapping reserves an index (16) in the buttons array for it, and Chrome on Mac does map this button when using Xbox and PlayStation gamepads.
However, the spec is a little vague on this point [2]. It states that "up to 17 buttons" can be included, and while the binding is shown in the standard_gamepad.svg, the table in the remapping section doesn't list it.
Given that it's not an API on iOS, and that it is a button that is often reserved for system use elsewhere, I removed it from the patch and left the buttons array at 16 elements only, rather than 17.
I do worry a little bit about web apps that assume that the buttons array will always be 17 elements long, so maybe there is a case to be made that the 16th index should be present but just always 0, but I didn't do that for now. It's an easy change to make if we want to do that.
[1] https://w3c.github.io/gamepad/standard_gamepad.svg
[2] https://w3c.github.io/gamepad/#remapping
--
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/41909013/attachment.htm>
More information about the webkit-unassigned
mailing list