Re: [w3c/gamepad] Vibrate feature for Gamepad (#19)

@razvanphp I think it would be good to support racing wheels through Gamepad API but so far there isn't enough interest to justify the work.

The main issue is that platform APIs historically haven't supported racing wheels very well so we'd have to put in a lot of effort on the browser side to deal with vendor-specific behavior and quirks. We do this in Chromium for a handful of popular gamepads but it doesn't scale. I'd like to see evidence of better platform-level support for wheels before we add explicit support to the spec.

A second issue is that racing wheels can be pretty dangerous since they use a powerful motor to turn the wheel. The device doesn't usually enforce any sort of safety precautions so it would be up to the browser to make sure the commands sent to the wheel don't harm the device or the user. I'm not sure that this can be done in a generic way, probably we would only want to support haptics on certified devices where we have some assurances about safety.

It's possible that Windows.Gaming.Input already does a good job of supporting racing wheels. I don't have access to all the necessary hardware so I haven't been able to test if WGI works consistently across wheels from different vendors. If you have access to the hardware and are willing to do some investigation, documenting the current level of support would be helpful as a first step toward justifying the API change.

The quickest path to supporting racing wheels in Chromium is through WebHID, but you'll need to craft the haptics output reports yourself. It might be better to do this anyway since even if we add support to the API it's likely that we won't support every feature of every wheel.

It should be possible to create a polyfill (a shim) that uses WebHID to communicate with a racing wheel but reformats the inputs to match the Gamepad API. Extensions like [ControlStadia](https://github.com/ihatecsv/ControlStadia) already do this to provide support for otherwise-unsupported wheels.

-- 
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/19#issuecomment-932423761

Received on Friday, 1 October 2021 17:30:45 UTC