SDL
SDL copied to clipboard
Wooting 2 always considered an XBox360Controller
Wooting 2 keyboards can be set in a few different "gamepad modes", including one "no gamepad":

However, regardless of which one it is set to, SDL will always pick it up as an XBox360Controller. I assume due to https://github.com/libsdl-org/SDL/blob/07af9baa86179a719b16c4fd672de78979c88e15/src/joystick/controller_type.h#L184 as the ID will always be 03eb:ff02 regardless of what mode the keyboard is in.
This can block input from an actual controller in some instances where the game can only handle one controller at a time and decides to pick up the W2 as the one (e.g., Yakuza 0 and I believe the other Yakuza Kiwami games too).
I don’t know if there is a way to detect the state from the keyboard to determine whether to broadcast it as an available controller or not, though. Maybe someone from @WootingKb might be able to provide insight?
In this current version of the Keyboard firmware (v1.30). The "No Gamepad" setting applies these changes which could be used to detect it:
USB Interface 0 becomes a "dummy" HID interface instead of the Xbox controller interface
BCD version is changed: i.e. 0.92 for "Xbox Controller" mode and 0.94 for No gamepad
Serial number prefix is changed i.e. WOOT_001 for Xbox mode and WOOT_002 for No gamepad
We plan to slightly alter this however, from the Lekker edition onwards we intend to be using our own Vendor ID as well as slightly different product ids for each gamepad mode setting to make it more easily identified and prevent some issues around controller calibration with DirectInput in Windows
The problem is that SDL don't really check if the interface is really for a Xbox controller.
Like the xpad code it would need to cross check the interface class, sub class and protocol number. Like 255 / 93 / 1 for a Xbox 360 wired controller and 255 / 93 / 129 for a wireless one.
Edit: The reason why the device IDs must be hard coded is that the used interface is vendor defined, but that don't mean that the interface check can be skipped.
https://github.com/torvalds/linux/blob/9b1f61d5d73d550a20dd79b9a17b6bb05a8f9307/drivers/input/joystick/xpad.c#L395
same issue here with my wooting 2, steam games ALWAYS sees a device called "Xbox 360 controller :wooting keyboard (xinput) and sometimes tries to use it resulting in my actual controller not working until i switch the priority. my os is manjaro linux
That problem should be limited to the older Flaretech keyboards from Wooting and I think it's caused by an unideal SDL implementation because the Xbox interface isn't properly checked. The Wooting keyboards are kind of complex and change their exposed function set (the USB interfaces) depending on the used analog mode. A normal controller don't do this and they have fixed USB interfaces and reports.
Because the Lekker keyboards from Wooting have different product IDs depending on the analog mode they should not have this problem.
So if the Flaretech keyboards get the update for the newer Wootility (v4) they get new device IDs and so this problem should become kind of irrelevant (at least for Wooting keyboards). But that may still take a while. :-(
I updated to the latest firmware (1.30.12) and now it shows up on SDL on Windows in "Xbox Controller" mode, but not in "Legacy Controller" or "No Gamepad" mode.
Interestingly it doesn't show up here on Linux as a controller in any mode.
So... it sounds like this is fixed?
@slouken For Linux you need to use xboxdrv in order the Wootings appear as a Xbox controller because the device IDs of the Wooting aren't yet included in xpad.
Here is a guide: https://help.wooting.io/en/article/guide-configuring-xinput-support-for-linux-69m32u/
SDL 2.0 is now in maintenance mode, and all inactive issues are being closed. If this issue is impacting you, please feel free to reopen it with additional information.