HOTAS, X52 Pro and low button/axes limit in Wine

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Post Reply
Patola
Level 1
Level 1
Posts: 9
Joined: Sat Mar 31, 2018 3:05 am

HOTAS, X52 Pro and low button/axes limit in Wine

Post by Patola » Tue Mar 24, 2020 1:57 pm

Greetings, fellow linuxers! There has been a time now I have a HOTAS kit (first a Thrustmaster Warthog, now a Logitech X52 Pro) and as I have played like Elite: Dangerous and Star Citizen through wine, I noticed some controls would not work, which I first attributed to maybe linux having poor device support.

However, I came to notice that native games like X4: Foundations and X: Rebirth perfectly support all the HOTAS controls, and went to investigate why wine games wouldn't work with some of the stuff. I then realized that my HOTAS kit with 8 analog axes and 39 buttons is greater than wine's limits (which seem to be of 6 axes and 32 buttons), which are kind of hardwired in a few scattered portions of the code. Mainly: dlls/joy.cpl/joy.h, dlls/joy.cpl/main.c, dlls/winebus.sys/bus_sdl.c and dlls/winejoystick.drv/joystick_linux.c.

I have successfully changed the code and the games seem to be responding well to my patch, however I get a lot of questions on why/how should I send it to the wine project and about the code... For example:
  • in driver_joyGetPosEx (joystick_linux.c) I see a lot of hardcoded expectations of axes "types" and positions in the list. It seems you must have a defined coordinate variable and type to use the value. What would happen if I would have an unknown type (which was the case with the "mouse wheel" of the X52 Pro thruster) or had two of the same type there?
  • There is also software like https://github.com/zvxryb/Linux-Virtual-Joystick which can aggregate two or more devices in one device that might easily overflow the limit. Windows users use that too, it is useful for games that do not support HOTAS which are more than one device, like the Egosoft X3 games. So, why this limit wasn't increased until today?
  • Where should I send my patch? To the regular wine project, wine-staging, or some other? What are the steps I could take to get it tested and sent to more game-oriented flavors of wine (like Proton) as soon as possible?
  • The joystick testing dialogs in wine control are not prepared for the increased amount of buttons and axes. How can I best change them to deal with that?

Post Reply