JibbSmart / JoyShockLibrary

Read DualSense, DualShock 4, JoyCon, and Pro Controller input on PC -- compiled for Windows, but code should work on other platforms.
Other
226 stars 42 forks source link

Unable to detect connected device #33

Open ozzyyzzo4096 opened 3 years ago

ozzyyzzo4096 commented 3 years ago

Hello,

I'm using non genuine but wired PS4 gamepad. unfortunately it doesn't seem detected properly by the library. (0 connected device from JslConnectDevices() it seems detected by some others programs like Parsec : HID controller #34 (0C12 / 1E1A)

dunno what's going on ? ^^ i will try to compile and check with sources :)

ozzyyzzo4096 commented 3 years ago

checked from sources it seems that your detection method is pretty limited resolving by product IDs seems a bad idea, also calculating a UniqueHandle for your unordrered map rather than using product id itself is strange, ^^ i will try to push another method to accept 'unknown' compatible DS4 devices.

JibbSmart commented 3 years ago

Hi Ozzy, I commented on your PR, but I'll comment here as well for those looking. Product IDs aren't unique across multiple identical devices, so they are not a suitable unique handle. Many non-genuine PS4 gamepads just use the same product and vendor IDs and then communicate just like a genuine PS4 gamepad. Those usually work fine with JoyShockLibrary already. Many of those that don't use the same vendor and product IDs also don't communicate in the same way as a genuine pad, so I'm quite happy for JoyShockLibrary to continue ignoring them :)

ozzyyzzo4096 commented 3 years ago

Hey, maybe you could handle 'compatible' devices (non genuine) in a different way ? restricting to genuine devices only is a bit rude ^^

JibbSmart commented 3 years ago

The only reason I'm restricting to "genuine" devices (or devices that pretend they're genuine) is I can reasonably expect them to just work. Like mentioned in the other thread, your controller has structured its inputs differently. It still communicates it in a way the PS4 / generic joystick readers can understand, but it'd be a lot of work to do that with JoyShockLibrary.