MrTimcakes / Unity-DirectInput

Unity Native Plugin to expose DirectX DirectInput ForceFeedback
GNU Lesser General Public License v3.0
31 stars 11 forks source link

Fanatec ClubSport wheelbase V2 not recognized. #9

Closed PetriAuvinen422 closed 1 year ago

PetriAuvinen422 commented 1 year ago

As the title says, the aforementioned wheel is not recognized by Unity-DirectInput. It could be that the wheel reports it's type as something unexpected. Unitys InputSystem reports it as UnityEngine.InputSystem.Joystick.

MrTimcakes commented 1 year ago

I think I know what the issue will be. I'd bet it's this check: https://github.com/MrTimcakes/Unity-DirectInput/blob/063f383e2889bbb5220e41184d4e93fe74485c47/DirectInputForceFeedback~/DirectInputForceFeedback/DirectInputForceFeedback.cpp#L449

Fanatec's later devices enumerate as two input devices to allow for extended capabilities (64+ inputs) but I think the CSW V2 is before this. I'd hope the check would sniff out the correct device of the two but I didn't have a CSW V2 at the time. I'll see what I can do.

MrTimcakes commented 1 year ago

I updated the check to detect the existence of the 2nd device instead of the primary. This way when no 2nd device is found, in the case of the CSW V2.0, the first device is used.

The CSW V2.0 has a GUIDPath in the form ...pid0001#... where newer devices have ...pid0005col01#... & ...pid0005col02#... for the 2nd device. The duplicate device check now looks for the existence of that "col02", which for modern devices col01 will not match and for older devices it also won't match as there's no "col" at all but will still trigger for the 2nd DirectInput device.

Fixed in 77b99081370b0d04cd43eaf1557a1b87a2e88754

MrTimcakes commented 1 year ago

If needed in the future image

image