How to detect gamepad triggers that are pushed using the USB HID API?

I use the RawInput + Windows USB HID API to receive the WM_INPUT message when I click the gamepad button and retrieve the status of the gamepad.

Problem: two triggers work on the same axis, which means that you cannot determine whether two triggers will be activated simultaneously. I observe the same behavior when starting the application to test the Windows OS gamepad. But I need to distinguish these two buttons pressed.

Note that XInput works as desired, it gives you two axes for two triggers, but I do not want to use XInput, because it is only for XBox controllers, and there are dozens of non-xbox controllers in the world.

I suppose there should be a way to read two axes via the USB HID API, but so far I have not been able to find it. Did you solve the problem?

Gamepad: XBox 360 is used (but any other should be supported).

OS: Windows 7.

IDE: Visual Studio 2010.

Language: C ++

+6
source share

All Articles