-
Notifications
You must be signed in to change notification settings - Fork 2.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
Bad joystick sorting on Linux #8166
Comments
Joysticks are presented in the order that SDL gives them to us. Someone would need to write a joystick provider module that works directly with the kernel to change the order and make GUID mapping work. |
Let's see what they say: libsdl-org/SDL#4430 |
That is a version of MAME so old it isn’t the same piece of software. It’s like suggesting copying Windows 2 code into Windows 2000. |
libsdl-org/SDL#4430 (comment) |
This issue is a misunderstanding of how MAME works anyway – the SDL joystick provider module presents joysticks in the order SDL reports them and uses SDLs UUIDs for stable controller mapping. This is consistent across targets that support the SDL joystick provider. |
Works great until you discover identical joysticks are impossible to manage because they have the same UUIDs and you have no clue which is which. |
This script fixes my issue: https://github.com/HugLifeTiZ/configs-scripts/blob/master/scripts/sdl-joystick-device |
Looks like it's fixed by this commit: libsdl-org/SDL@ba8bc14 |
On Linux, joysticks should by default be sorted by their device files (/dev/input/js*).
Joystick 1 should be "/dev/input/js0", joystick 2 should be "/dev/input/js1", and so on. This was the default behavior on older MAME versions, and it simply worked.
Currently they are sorted in the opposite order. Last joystick always gets enumerated as "joystick 1", the last but one always gets enumerated as "joystick 2". This is super counterintuitive.
Right now it's impossible to use "-joy_idx*" or "mapdevice" to sort joysticks on Linux if you have multiple devices with the same name/GUID.
Also, "-joy_idx*" and "mapdevice" should accept "/dev/input/js*" as parameter, to make things easier.
The text was updated successfully, but these errors were encountered: