Duplicate joysticks when using DS4Windows

Now that GLFW 3.2 supports XInput and DirectInput joysticks, I’m seeing duplicate devices. For example PS4 controller shows up twice. Is there some way to detect which one of the duplicate devices is the XInput one?

I would like to somehow either filter out DirectInput devices completely or automatically pick the XInput one, when duplicate devices are detected. Does anyone have ideas on how to do that?

This sounds like a potential bug, so I’d file it on the GLFW Github issue tracker, making sure to add details like your system OS, joysticks tested, version of GLFW used etc.

I don’t think this is a bug. Unless GLFW specifically tries to hide duplicate devices through different APIs.

The PS4 controller (using DS4Windows tool) shows up as both DirectInput and XInput device. I’m not sure if it’s even possible to detect which two devices are duplicates.

I was just hoping I could find out which API a GLFW joystick is using…

There’s no GLFW function that I’m aware of for getting the API used by a joystick, this might need a feature request (submitted through the same issue tracker as above).

You could check if the joystick name gives any useful information.

Ok, thanks!

I took a look at GLFW sources and it does give hard-coded name for XInput gamepad, so I could use that, as long as the direct input device doesn’t use the same name. I will have to try this later.

GLFW does try to detect and eliminate duplicates via the different APIs (see supportsXInput) but this apparently fails for the PS4 controller. I don’t have a PS4 controller myself but I can write a program that will give me the information I need to fix this.

I’ve opened the issue below in the meantime.


I finally got round to writing the tool that will let us work on this and similar issues. Unfortunately, it seems that DS4Windows lies really well and I’m not sure I’ll be able to detect whether it’s a real 360 controller in addition to the PS4 one or if it’s faked by the tool.

Will look into it further.

Anyone reading this thread, please come join us in the GitHub issue above instead.