简体   繁体   中英

How do racing games communicate with USB force feedback steering wheels?

How do steering wheels with force feedback send motor data using USB (HID i suppose)? I'm pretty sure that ones without force feedback just show up as joystick HID devices. I've tried browsing around Microsoft docs and the only documentation I could find is the Windows.Gaming.Input UWP namespace, but it didn't give me any info on how anything works behind the back. I'd really love to write some kind of driver, but there's completely no information or examples involving steering wheels.

I've found an MS docs article titled "Using Force Feedback" from 2009, but again, it doesn't show how to receive the data from software. Only a few C# examples on creating a device and configuring it for FFB were provided.

Modern USB/Bluetooth gaming devices are indeed using USB HID spec as a backend.

Force-feedback is documented in Device Class Definition for Physical Interface Devices (usually called HID PID ) extension spec. Whole spec was modeled by Microsoft DirectInput engineers in late 90x and DirectInput was kind of thin wrapper around USB HID PID spec and thick wrapper around older GamePort/ComPort vendor-spec stuff - so their docs could be handy to understand how to deal with this stuff.

But be aware that DirectInput is deprecated already - you have to use Windows HID API or mentioned Windows.Gaming.Input.ForceFeedback UWP API.

Also I can suggest you to search for DirectInput code in leaked Windows XP source code - it could help a lot too.

PS: Gamepad vendors are tend to use vendor-defined HID usages to add vibration support to their gamepads. Unfortunately there is no common approach on this. Even different versions of Xbox One gamepads have different vibration implementation. :(

But gaming wheels force feedback is usually implemented by means of HID PID spec.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM