javascriptgamepadhaptic-feedbackgamepad-api

Set steering wheel angle using Gamepad API


Is it possible to set a specific angle for a Logitech G29 steering wheel using the HTML5 Gamepad API?

I assumed the GamepadHapticActuator could be used, but the only GamepadHapticActuatorType is vibration.

Also, the possible playEffect() type argument values are only dual-rumble or vibration, I don't see any way to manually set a force-feedback motor angle.


Solution

  • No, GamepadHapticActuator only supports rumble effects and doesn't support wheel actuators at all.

    Logitech G29 uses the Human Interface Device (HID) protocol, so if you're using a Chromium-based browser you can control the wheel angle with WebHID API. See here for a demo.