Re: Generic Sensor API and Gamepad API?

On Tue, Nov 1, 2016, at 04:06 PM, Vincent Scheib wrote:
> I'm curious for an early feasibility check of using the Generic Sensor
> API to support Gamepads.
>
> I have mixed initial instincts, given that Gamepads are fairly
> specialized HIDs with a cluster of sensors that are appropriate to
> manage in a first class way. However, those working on the Generic
> Sensor API may have reasonable arguments for how this may come
> together nicely after all.

This is an interesting idea, to be sure, but one thing that I don't see
any mention of in the Generic Sensor API spec is the concept of a
collection of sensors. Obviously one of the most important pieces of the
Gamepad API is that it exposes all the buttons/axes of each gamepad
grouped into a device.

If I had a do-over on the Gamepad API I would probably write it as a
"Web USB HID" spec instead. The biggest problem we've seen in practice
is that devices that look physically very similar can expose very
different HID descriptors and the Gamepad API spec doesn't specify how
to map from a HID to buttons/axes. Additionally, platform drivers (like
the joystick driver on Linux) can have their own layer of mapping and
this makes it really hard to present a consistent interface across
platforms/devices/browsers.

-Ted

Received on Wednesday, 2 November 2016 14:42:03 UTC