liballeg / allegro5

The official Allegro 5 git repository. Pull requests welcome!
https://liballeg.org
Other
1.8k stars 280 forks source link

Joystick layout is unpredictable across joysticks and platforms #579

Open SiegeLord opened 8 years ago

SiegeLord commented 8 years ago

See https://www.allegro.cc/forums/thread/614923/1008537, https://www.allegro.cc/forums/thread/614996/0 and https://mail.gna.org/public/allegro-developers/2015-03/msg00007.html.

beoran commented 8 years ago

Yeah, this is a problem I'm well aware of but that is hard to fix duie to the inconsistency of joystick layouts , even for the same joystick, between OS.... a GUID+database approach may be the best we can do for now.

katastic commented 1 year ago

So this unfixed issue is affecting another user.

https://discord.com/channels/993415281244393504/1116086421418164294

I suggest using the FOSS, public DB of joystick mappings people have already painstakingly put together 2000 entries across multiple operating systems (including phones like iOS) here:

https://github.com/gabomdq/SDL_GameControllerDB/blob/master/gamecontrollerdb.txt

either copy the file straight and attribute it, or use git's built in dependency embedding thing so any updates to theirs will be included automatically when you do a git pull.

katastic commented 1 year ago

I also note that fill_joystick_axes appears to be broken on my Linux box with 360 controllers. It does not notice that the left and right throttles are singular axes. So it attempts to combine the next stick into the throttle. (a simple divide by 2 axis-into-sticks assignment)

ala

virtual stick1: [hw stick 1 axis 0,1] virtual stick2: [throttle, and one axis from hw stick 2]

image

https://github.com/liballeg/allegro5/blob/db64a60fdb7219a6f73a3b51d1d099144fe065ca/src/linux/ljoynu.c#L343

it seems like is_single_axis_thottle() (linked below) is failing to register correctly the throttle and so the function goes into normal (divide by two) axis allotment

https://github.com/liballeg/allegro5/blob/db64a60fdb7219a6f73a3b51d1d099144fe065ca/src/linux/ljoynu.c#L167