I trying to use
Sony DualShock 4 and
Google Stadia controllers via
Windows.Gaming.Input API with vibration feedback.
They are both HID gamepads that get detected as
RawGameController. Its ok, but
RawGameController.ForceFeedbackMotors fields are just empty in these cases. Seems they are not announcing vibration support via HID descriptor. This is a fairly common case.
According to MSDN seems there is possible to implement a custom Windows.Gaming.Input.IGameController:
This interface exists mainly to support extensibility for game controllers, which allows OEMs (Original Equipment Manufacturers) to publish WinRT (Windows Runtime) classes that provide rich access to their device's features, while integrating into the underlying game controller device enumeration framework.
As I understand it can be done via GameControllerFactoryManager.RegisterCustomFactoryForHardwareId() call and providing a custom ICustomGameControllerFactory in it along with needed usb
ProductId. And then somehow sending special HID Output Reports (DualShock4, Stadia) for these controllers via HidGameControllerProvider.SendOutputReport() method.
Can I do such trick in my application via C++/WinRT for full support of such gamepads? Could you provide any example of such classes?
Appreciate any help.