Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smart default mapping for controller #3088

Open
bilhox opened this issue Aug 30, 2024 · 4 comments
Open

Smart default mapping for controller #3088

bilhox opened this issue Aug 30, 2024 · 4 comments
Labels
controller pygame.controller Experimental Experimental code

Comments

@bilhox
Copy link
Contributor

bilhox commented Aug 30, 2024

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 the controller 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 ?

@bilhox bilhox added Experimental Experimental code controller pygame.controller labels Aug 30, 2024
@damusss
Copy link
Contributor

damusss commented Aug 30, 2024

why not, yeah. maybe enabled by some flag

@Starbuck5
Copy link
Member

Wdym it was wrong? Isn’t the whole point of SDLs controller system to map everything to be like an Xbox controller?

@bilhox
Copy link
Contributor Author

bilhox commented Aug 31, 2024

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 :
image

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)

@bilhox
Copy link
Contributor Author

bilhox commented Aug 31, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
controller pygame.controller Experimental Experimental code
Projects
None yet
Development

No branches or pull requests

3 participants