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
Level 2
Level 2
Posts: 10
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 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?

User avatar
Posts: 1
Joined: Thu Jul 02, 2020 2:48 pm

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

Post by BradleyR » Thu Jul 02, 2020 3:05 pm

I unfortunately cannot answer your questions as I have only recently started using my Fedora install for gaming - a final move off Windows, game support was the only thing keeping me there - and thus am not versed in Wine's joystick code or project management whatsoever. However, your post was linked to me on Reddit as a possible resolution to an issue similar to yours described above.

I use a VKBSim Gladiator MK.II, Thrustmaster TWCS and Saitek Pro Flight Rudder Pedals - the stick and pedals work fine in Wine games - Star Citizen has been my testbed for this - but one axis on the throttle is not passed through Wine control and onto a game. Interestingly, a joystick test software under Wine detects throttle just as the host system does, meaning it must be problem with Wine rather than my games or hardware. This has been independently replicated by another Reddit user who described the problem as near identical to mine and thus also yours:
I haven't been playing SC lately, but unfortunately I haven't found anything yet. I'm thinking as opening it as an issue directly with Wine though, since I'm pretty sure that's where the problem is happening.
So if you are willing and able, I'd be happy to implement and test your patch if you were to share it - I'm sure others with this issue would too.

Post Reply