-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent joysticks from being seen as gamepads #4579
Comments
I'm currently using the following snippet in my launcher wrapper script to hide the joysticks from all games by default except I set
Maybe it helps someone. The VID/PID codes are for the Thrustmaster 16000 HOTAS. |
I support this. This is especially annoying, if you actually want to use a joystick (so deactivating it like above is not a solution). |
This is getting more and more annoying if you have a joystick device that is affected by this problem and you can't properly use it. This bug/regression basically renders my pedals useless … |
It should work by setting:
with VID/PID being a upper case 4-digit hex value, and your user must have read access to the hidraw device (can be done via udev). E.g. I'm using:
to ignore my VKB and Thrustmaster from being detected as a gamepad but still being detected as a joystick. You may currently need to clear the prefix due to driver caching issues in the registry (the registry may still link those devices to the xinput driver). You can also selectively remove all references to the vid/pid from See also: |
Thanks for the suggestion, I already know about the variable PROTON_ENABLE_HIDRAW variable. Was actually there when it was created. ;) Anyways, even if hidraw would be working, it would still be just a workaround. The current SDL implementation they have in Steam is clearly misbehaving and doing something that it should not do. It'd be ok if there would be a variable to disable that behavior or even better a switch in the controller menu of Steam, but there isn't. |
btw, the original Wine does have this implemented:
But of course I've tried that and it doesn't work with Proton's implementation. |
Proton doesn't use SDL in this case, the joysticks are detected via udev and hidraw. If you revoke hidraw permissions, that setting might apply. |
This is not one of the devices that uses hidraw per default, so I think it would need to be enabled using the PROTON_ENABLE_HIDRAW variable, which I did not (or rather I removed that before testing).
So this device, for some reason, gets detected by the kernel as a "gamepad", while all the others are getting detected as "joystick".
No idea, why that is, but I guess it's not Proton's or SDL's fault that it's wrongly detected then. |
Technically, for user space to identify a device, it should look at the keymap: If the device has See: https://github.com/torvalds/linux/blob/master/include/uapi/linux/input-event-codes.h There's a Linux often just uses generic HID drivers for input devices - and this works in most cases. But it doesn't work in some cases. The best is probably to enable It may also be useful to submit evemu-describe results to SDL, examples: https://github.com/libsdl-org/SDL/issues?q=is%3Aissue+evemu-describe |
Be careful with that. It really depends on the implementation. The controller of my pedals has pins available that can be used to connect buttons to it.
I'm more than happy to use hidraw for these devices, if you tell me how to calibrate them using wine. ;)
Will investigate, thanks. |
I put together a patch to still use udev for device classification even if in a container. If anyone want to try it, I rebuilt libSDL2 for all the current steam runtimes. You can get them here (see the README.txt file for how to install them). Note that this may not effect all programs. You can check what libSDL2 a program is using by running
where |
Still an issue: My virpil devices, namely joysticks, are detected as xbox controllers. |
As of August 28 2004 (today) the steam general availability release is only on SDL 2.30.2. This is not a recent enough version as it is missing this commit. Try the public beta as it is SDL 2.30.6, which has everything. |
To be clear, this this will only address you issue if you device is classified properly in udev and the steam container is running such that it has access to your udev classification (i.e., not it flatpack). |
Feature Request
I confirm:
contain this feature already.
Description
Currently, joysticks (e.g., my HOTAS with stick, throttle and paddles) is detected as a gamepad. Several games become confused by this, e.g. Batman Arkham Knight only allows the first gamepad detected to be used, so this is usually my HOTAS. Other games just turn the player wildly around because some throttle is offset from an imaginary center point (which a throttle doesn't have). Additionally, the joystick cannot even be used properly as a gamepad input because
BTN_{A,B,X,Y}
does not exist on those.Maybe we could add an environment variable which allows to blacklist joysticks per game, or they should generally not be available as xinput devices at all (Proton could detect that by looking if there's a
BTN_GAMEPAD
event key code in the mapping). This is probably an SDL2 thing, and I'm not sure if Proton could even tell a gamepad from a joystick with SDL2 because it probably only reports axes and buttons but not their original evdev symbolic names.The core problem is probably that SDL2 treat joysticks and gamepads as the same type of device although they are vastly different input devices. So a proper fix is probably to flag the devices properly in SDL2.
I think there's
SDL_GAMECONTROLLER_IGNORE_DEVICES=0xVVVV/0xPPPP,...
to do this, I will try that. But Proton could probably make that easier by either automating this or curate a list of devices so that we could easily fix it with a one shot variable, e.g.PROTON_NO_JOYSTICKS=1 %command%
.Justification [optional]
Usage of SDL2 for xinput is probably not even part of Wine, so it's a Proton thing.
Risks [optional]
References [optional]
Related but different use-case: #3288
The text was updated successfully, but these errors were encountered: