Patch to fix HOTAS / button/axis limit problems

Cláudio Sampaio patola at gmail.com
Sun May 17 05:24:07 CDT 2020


Hi all, I am a heavy user of wine and proton for games and for some time
the failures some games had with my HOTAS (Hands On Throttle-And-Stick)
have been bothering me. I tried to take a look at wine code and found out
that the maximum numbers of buttons for a single device was hardwired to 32
and the maximum number of analog axes was hardwired to 4 pairs (8 axes). My
own HOTAS, a very common Logitech X52 Pro, has a bigger number of buttons
-- 39, so the higher buttons would "carry over" to register like they were
lower buttons -- and this prevented it from working on games. I increased
these hardwired numbers to 64 and 8 respectively, and the patch seems to
have largely worked on all games I used it -- for example, I am only able
to play Elite: Dangerous with my patched proton version.

However, there have been some problems, like a few sliders not working --
slider 7 (you could check the numbering of axes with a program like
antimicro on Linux) does not seem to register in Star Citizen, for example.
I noticed from joystick.c that the analog axes seem to have specific names
and functionality, like DIJOFS_RX and DIJOFS_SLIDER, and if I understood
what's going on, it might prevent the code to work generally with obscure
devices that have a couple number of sliders, is that correct? How could I
get the code to recognize and translate my axes to games?

Also, for this patch to be complete I will also need to change the GUI for
testing joystick via "wine control", and I do not have much experience with
Windows programming. Any help would be welcome.

I have also described the problem on this forum post:
https://forum.winehq.org/viewtopic.php?f=2&t=33615&p=126895#p126895
And the bug report for it at https://bugs.winehq.org/show_bug.cgi?id=48799
And I have also talked about it on gamingonlinux:
https://www.gamingonlinux.com/forum/topic/4330

This patch has around 50 to 60 hours of testing.
-- 
Cláudio "Patola" Sampaio
MakerLinux Labs - Campinas, SP
Resume <https://github.com/Patola/resume> Gmail <patola at gmail.com> -
MakerLinux <patola at makerlinux.com.br> - YOUTUBE
<https://www.youtube.com/user/makerlinux>!
Facebook <https://www.facebook.com/patolinux> - Facebook da MakerLinux
<https://www.facebook.com/makerlinux> - Lattes
<http://buscatextual.cnpq.br/buscatextual/visualizacv.do?id=K4763932Z5>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20200517/7badabaa/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dirty-patch-hotas.diff
Type: text/x-patch
Size: 3080 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20200517/7badabaa/attachment.bin>


More information about the wine-devel mailing list