pygame-community / pygame-ce

🐍🎮 pygame - Community Edition is a FOSS Python library for multimedia applications (like games). Built on top of the excellent SDL library.
https://pyga.me
947 stars 158 forks source link

8 axis joystick (1821) #1018

Open GalacticEmperor1 opened 1 year ago

GalacticEmperor1 commented 1 year ago

Issue №1821 opened by davieli2 at 2020-05-19 17:51:50

Hi, I'm using an eight axis joystick board module (Leo Bodnar BU0836A) but only 6 axis are find with joy.py tool, obviously windows see all eight axis Davide

Related Docs: https://www.pygame.org/docs/ref/joystick.html# pygame.joystick.Joystick


Comments

*MyreMylar commented at 2020-05-19 18:47:24*

I think that means you need to patch SDL joystick with this boards control mapping, see:

https://hg.libsdl.org/SDL/file/bb68bb2d5ccb/src/joystick/SDL_gamecontrollerdb.h

pygame just gets the number of axes reported by SDL.

If you can't do it yourself you could also log a detailed bug, preferably with C code here:

https://bugzilla.libsdl.org/enter_bug.cgi


*MyreMylar commented at 2020-05-20 14:28:48*

I also noticed later that SDL appears to map all 'joysticks' to emulate PS4/PS3/X-Box controllers so it may be that an 8 axis board will not work with SDL easily. Though again, they are the people to ask.

Let us know if you log a bug there and we can link it to this issue.


*davieli2 commented at 2020-05-20 15:19:24*

I think I'm not able to patch the SDL joystick and basically Pygame works good, the problem is only that pygame not see all axis that Windows see (8)... could you help me in some ways ?? thanks


*MyreMylar commented at 2020-05-20 15:33:07*

We can't fix it in pygame, pygame in many instances is a wrapper around SDL which interfaces with the hardware like your particular board.

SDL has a predefined set of joysticks and if your board isn't on the list it won't pick it up. Plus, I believe SDL just shoves all joysticks/controllers into emulating one of the popular six axis controllers (Ps4/X-box) so it may not work easily.

My advice is to explain your problem to SDL on their issue tracker here. Explain that SDL doesn't pick up all eight axes of your board:

https://bugzilla.libsdl.org/enter_bug.cgi?product=SDL

And see what they say, you will also need to tell them the Vendor ID (VID) and Product ID (PID) of your board:

https://cronusmax.com/forums/showthread.php/146994-How-can-I-find-the-Hardware-ID-(VID-PID)-of-my-controller


*MyreMylar commented at 2020-05-24 15:55:30*

This issue is now open on the SDL bugzilla here:

https://bugzilla.libsdl.org/show_bug.cgi?id=5149

MyreMylar commented 1 year ago

The issue I opened with SDL was deemed to be a duplicate of this one:

https://github.com/libsdl-org/SDL/issues/3561

which remains unresolved.