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

supermodel: convert sdl joystick api to gamecontroller api #13527

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

aderumier
Copy link
Contributor

supermodel use the old joystick api, so the sdl gamecontroller mapping don't work.

This is giving wrong axis alignement (gaz instead break), non normalized axis values (gaz/break reversed)

This patch convert the axis part currently to gamecontroller, the joystick api is still used for hats.

@dmanlfc
Copy link
Collaborator

dmanlfc commented Feb 17, 2025

ideally it should use SDL_GameController for all methods rather than a mixture of api implementations.
that way you can upstream it to the supermodel devs as well @aderumier

@aderumier aderumier force-pushed the supermodel-sdl-gamepad branch from f1ab75a to e1439ef Compare February 17, 2025 15:54
@aderumier
Copy link
Contributor Author

ideally it should use SDL_GameController for all methods rather than a mixture of api implementations. that way you can upstream it to the supermodel devs as well @aderumier

yes, I'll try to improve the patch next week. (I have differents gamepad && 2 wheels to test). It should help to cleanup the generator too without need translations.

@dmanlfc dmanlfc marked this pull request as draft February 17, 2025 22:21
@dmanlfc
Copy link
Collaborator

dmanlfc commented Feb 18, 2025

looking better, let me know when you're happy & take it off draft

@aderumier aderumier force-pushed the supermodel-sdl-gamepad branch 6 times, most recently from 4e4faef to 6723135 Compare February 26, 2025 15:58
Alexandre Derumier added 2 commits February 26, 2025 17:02
currently, supermodel only implement the sdl joystick api.

That mean that if we use different controllers, they need to be correctly remapped && calibrate each time.

This patch implement sdl gamecontroller api, through "InputSystem = sdlgamepad" config
which normalize the mapping && calibration.

gamecontroller is matching x-input on windows, so the limit is 6 axis (with 2 separated Z triggers axis),
4 dpad/hats and 16 buttons. (x-input is limited to 10buttons).
@aderumier aderumier force-pushed the supermodel-sdl-gamepad branch from 6723135 to d51cb64 Compare February 26, 2025 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants