ViGEm - DS4 Gyro/T-PAD Emulation Extension
ViGEm is Windows kernel-mode driver emulating well-known USB game controllers. It supports Xbox 360 and DS4 emulation, which I conveniently use in BetterJoy.
The main feature ViGEm lacked was the ability to emulate DS4 gyroscope/accelerometer and touchpad inputs, which would allow better compatibility with programs that accept DS4 as input, such as Steam and PS Now. Furthermore, ViGEm “aims for a 100% accurate emulation of well-known gaming peripherals as pure software-based devices at kernel level”, so I thought it a bit silly that this wasn’t a feature.
I had a crack at the problem, and after a few days of staring at conflicting HID report documentation and fighting compiler struct packing, I managed to get it working. Hopefully the change will be pushed to the main branch of ViGEm soon.
Native SDK code can be found here, and the .NET bindings here.