I want to see implementation of SendDeviceData.
I am currently implementing a virtual joystick driver that will encapsulate multiple joystick devices into one because older games can see only one and only the first joystick device. If you have flight stick, rudder, throttle for example, you need to combine them into one device. This part is already working.
Now I'm messing with Force Feedback (FFB) in Direct Input.
I can use CreateEffect and such. But as I'm working only on a simple routing of joystick direct input data, I want to use SendDeviceData to directly send FFB packet I already have received from Direct Input app (ie. game or FFB testing software).
Example of FFB packet:
Code: Select all
DataSize: 30, CMD: IOCTL_HID_WRITE_REPORT
1A010101FFFFFF00000000FFFF04FF5F0000000000000000000000000000
BlockIdx: 1
Device ID: 1
Packet type: Effect
EffectType: ConstantForce
Duration: -1
TriggerRepeatInterval: -1
SamplePeriod: 0
Gain: 0
TriggerBtn (?): 0
Polar: True
Angle: 360
They mention applications should not use this method directly. Which means it is possible, just not recommended. But for routing scenario, it is more that recommended to simply reroute the packet. Currently I have a complex async packet mapper + parser + then reconstructing individual CreateEffect / Start / Stop calls. But I'm running into issues with latency and also there is a lot of unnecessary reprocessing of effect parameters.
For the sake of simplicity, I am currently testing it on Windows 10 (I have Windows XP as well).