Jump to content
  • Advertisement
Sign in to follow this  
Cygon

Matching DirectInput devices to XINPUT devices

This topic is 2858 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

In my XNA game, I'm naturally using XNA's GamePad class, which is based on XINPUT (in other words, only supports XBox 360 controllers).

Because I want to allow PC players to use standard PC joysticks and game pads, too, I'm using DirectInput (via SlimDX) there to query these devices.

The problem is that my XBox 360 controller is enumerated by DirectInput, too, so I'd access it two times using two different APIs.

Is there way to see whether a DirectInput device supports XINPUT?
Or better yet, can I match up DirectInput devices to XINPUT devices somehow?

Share this post


Link to post
Share on other sites
Advertisement
For now, I solved it by checking the ProductGuid of the DirectInput controller:

private static bool isXInputDevice(DeviceInstance deviceInstance) {
Guid xbox360ControllerGuid = new Guid("{02a1045e-0000-0000-0000-504944564944}");
return (deviceInstance.ProductGuid == xbox360ControllerGuid);
}


The ProductGuid is the same for both of my XBox 360 wireless controllers. I don't have anything else (wheel, wired controller, chat pad, head set) to test with, so I cannot verify that this is the way to go.

Anyone here with an XBox and some extra gadgets willing to check the ProductGuids for those devices?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!