SDL icon indicating copy to clipboard operation
SDL copied to clipboard

Wooting 2 always considered an XBox360Controller

Open Freso opened this issue 4 years ago • 6 comments
trafficstars

Wooting 2 keyboards can be set in a few different "gamepad modes", including one "no gamepad": screenshot from Wootility 3.6.15

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?

Freso avatar Apr 03 '21 10:04 Freso

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

simon-wh avatar Apr 06 '21 14:04 simon-wh

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

Rocky04 avatar May 03 '21 19:05 Rocky04

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

XDM-Inc avatar Jun 26 '22 22:06 XDM-Inc

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. :-(

Rocky04 avatar Jul 05 '22 21:07 Rocky04

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 avatar Sep 08 '22 23:09 slouken

@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/

Rocky04 avatar Sep 12 '22 12:09 Rocky04

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.

slouken avatar Nov 07 '23 02:11 slouken