ToadKing / wii-u-gc-adapter

Tool for using the Wii U GameCube Adapter on Linux
MIT License
241 stars 44 forks source link

Forward usb id of the adapter to controller devices (allows detection by steam) #51

Closed manuelVo closed 4 years ago

manuelVo commented 4 years ago

Currently the driver doesn't expose a usb id in the controller devices. Instead vendor and prdocut number are set to zero. This causes those controller devices not to be recognized by programs that rely on the usb id for detecting controllers (one popular example would be steam).

This PR forwards the usb id of the adapter to the usb devices created for each controller, which causes the controllers to be detected by steam (and possibly other software relying on the usb id).

This fixes #40

ToadKing commented 4 years ago

We only need to work for one PID/VID so the extra querying for it from libusb is redundant. The few places they're used in the file can be moved to #defines and we can just assign it directly from there.

I'm slightly concerned about conflicts in the future if someone ever comes and does proper kernel support for the adapter which would also use the real PID/VID but nobody has for six years now so it's probably fine.

manuelVo commented 4 years ago

I was under the impression that a third party adapter could have a different usb id and wanted to account for that. However the wii u probably wouldn't detect those adapters then, so this scenario is unlikely, making hard coding the id the better option. I've changed the PR accordingly.

As for future conflicts because of the ID I'm less concerned. I think this driver and a possible kernel driver would conflict anyway because both would try to send force feedback commands to the same device.