Sorry, the Forum is closed :(

Unfortunately, the forum is now closed.

Please read the following post for further details.

We apologize for the inconvenience.
The SharpDX team.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: [XInput & DirectInput] Check XInput ability of a DirectInput device

[XInput & DirectInput] Check XInput ability of a DirectInput device 2 years 2 weeks ago #384

Hi,
So I'm trying to handle gamepads with both XInput and DirectInput.
I want to handle XInput devices with XInput, and other devices with DirectInput.

DirectInput provides a list of SharpDX.DirectInput.DeviceInstance that contain information such as GUIDs and device names.
The list contains all connected devices, including XInput devices (which is normal).

Now I want to know which of these devices support XInput.

However, in the SharpDX.XInput.Controller instances built with XInput, there are no GUID or product name information.
I can't find how to figure out if a DirectInput.DeviceInstance refers to the same device as a XInput.Controller instance.

In this article, Microsoft provides a function that checks the XInput compatibility of a device. I understood that they use a "Device ID" provided by XInput and check if it contains the string "IG_".
Is there a way to do the same with SharpDX.XInput? How?
The administrator has disabled public write access.

Re: [XInput & DirectInput] Check XInput ability of a DirectInput device 2 years 2 weeks ago #385


  • Posts:843 Thank you received: 1
  • xoofx's Avatar
  • xoofx
  • Administrator
  • OFFLINE
Unfortunately, there is no way to do it other than the solution described in the article. So you will have probably to create a C++/CLI component to provide the IsXInputDevice(guid) method.
The administrator has disabled public write access.

Re: [XInput & DirectInput] Check XInput ability of a DirectInput device 2 years 2 weeks ago #386

Thanks.
I guess I'll be trying that.
The administrator has disabled public write access.

Re: [XInput & DirectInput] Check XInput ability of a DirectInput device 2 years 2 weeks ago #398

Just to complete the topic, there is a way to obtain the "DeviceId" with SharpDX.DirectInput.
This information is accessible in the SharpDX.DirectInput.Joystick.Properties.InterfacePath property.
You can test if the string contains "ig_" to know the XInput compatibility of a device. But there is still no way to identify a SharpDX.XInput.Controller.
The administrator has disabled public write access.

Re: [XInput & DirectInput] Check XInput ability of a DirectInput device 2 years 2 weeks ago #400


  • Posts:843 Thank you received: 1
  • xoofx's Avatar
  • xoofx
  • Administrator
  • OFFLINE
Doublevil wrote:
Just to complete the topic, there is a way to obtain the "DeviceId" with SharpDX.DirectInput.
This information is accessible in the SharpDX.DirectInput.Joystick.Properties.InterfacePath property.
You can test if the string contains "ig_" to know the XInput compatibility of a device. But there is still no way to identify a SharpDX.XInput.Controller.
I don't understand, if you are able to identify XInput device from DirectInput list, you can remove them from this list. Why would you need an id in XInput?
The administrator has disabled public write access.

Re: [XInput & DirectInput] Check XInput ability of a DirectInput device 2 years 2 weeks ago #401

Well, that would provide additional information about the XInput controller.
Being able to link XInput.Controller and DirectInput.Joystick means you would be able to tell which device model you are dealing with, its display name, etc. That would be ideal.

Anyway, as you said, the main problem is solved. I'm just going on without this.
The administrator has disabled public write access.

Re: [XInput & DirectInput] Check XInput ability of a DirectInput device 2 years 2 weeks ago #409


  • Posts:843 Thank you received: 1
  • xoofx's Avatar
  • xoofx
  • Administrator
  • OFFLINE
Yeah, XInput is a really weird API, somewhat a successor of DirectInput, but almost empty and lacking severe basic things like device information...
The administrator has disabled public write access.
  • Page:
  • 1
Time to create page: 0.172 seconds