Re: [w3c/gamepad] Mapping of HID Events to the Gamepad API (#56)

(An update on my thoughts here)

Been hacking on WebKit's HID implementation over the last few weeks, digging deep into the HID weeds.

There's simply no way to do this right. HID descriptors are "standardized" and you can match an input report up to the elements in the descriptor... but beyond that...

I have on my desk:
- A controller that reports (4) x-axis, but only updates the 4th one when the x-axis moves
- A controller that reports 10 buttons, with only 8 physically on the device
- A controller that reports 11 buttons, with only 8 physically on the device
- A controller that reports a z-axis, but there's no analog stick or other element on the device that controls its value. In fact, it's value just moves around randomly
- A controller with a 4-bit hat switch d-pad that uses the values 1-8 to report the 8 possible activations, and 9 to report the null position
- A controller with a 4-bit hat switch d-pad that uses the values 10-3 to report the 8 possible activations (opposite direction from the previous controller) and 2 to report the null position
- A controller that reports 19 buttons but only has 17
- That same controller offers analog values for 12 of its buttons through 12 "pointer" elements that don't have any specific usage - just "pointer"

I'm afraid individual controls have individual mapping needs, and there's no way a w3c spec can accommodate that generally speaking.

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

Received on Friday, 31 July 2020 06:34:45 UTC