Open bilhox opened 2 months ago
why not, yeah. maybe enabled by some flag
Wdym it was wrong? Isn’t the whole point of SDLs controller system to map everything to be like an Xbox controller?
Wdym it was wrong? Isn’t the whole point of SDLs controller system to map everything to be like an Xbox controller?
Yes! Sorry for the misunderstanding also, I thought it would also take in account controllers like SNES Controller which looks like this :
It just doesn't have sticks and shoulders button/trigger.
The button A and B are inverted on my nintendo joycons as well. (when they are combined*) (zoldalma inverted the 2 buttons in his test code)
Someone shared me this on the SDL discord, it might be worth taking a look at it : https://github.com/mdqinc/SDL_GameControllerDB/tree/master
While playing with _sdl2.controller, I found that for all controllers I had, default mapping was wrong. Okay, we propose a way for users to set their mapping, but wouldn't be ideal for the comfort of users to propose smart default mapping that matches the button/axis constants proposed by the controller module ?
That is the point of the SDL_Controller (or SDL_Gamepad in sdl3) module. We should not need to keep our own database of controller layouts. It should just work. And if it does not, we make a PR to sdl.
With that said, we could vendor in the one you linked (https://github.com/mdqinc/SDL_GameControllerDB/tree/master). Or mention it in the docs.
Looks like SDL has a function for loading mappings from a file, could be interesting to implement it. (Which would close this issue)
I actually requested that the mapping adding function be bound in the contributing discord. My use case is that I have a USB gamepad that I found buried in a closet that looks like a PS2 controller but doesn't register as an SDL2 controller. I'd like to be able to test using it.
Hello,
While playing with
_sdl2.controller
, I found that for all controllers I had, default mapping was wrong. Okay, we propose a way for users to set their mapping, but wouldn't be ideal for the comfort of users to propose smart default mapping that matches the button/axis constants proposed by thecontroller
module ?What I can propose is to do like some people in the SDL community do, keeping a database of the most used controllers in the world with their default mapping.
What do you think ?