Skip to content
This repository has been archived by the owner on Jul 6, 2023. It is now read-only.

Port to SDL_GameController API #13

Closed
drfiemost opened this issue Dec 9, 2021 · 6 comments
Closed

Port to SDL_GameController API #13

drfiemost opened this issue Dec 9, 2021 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@drfiemost
Copy link
Owner

drfiemost commented Dec 9, 2021

Port to new SDL_GameController API to have a consistent experience with game controllers, see #7
Maybe take the chance to get rid of old SDL too?

Edit:
also implement force-feedback support

@s1eve-mcdichae1
Copy link

Heads-up, this is working fine with my namebrand Logitech controller, but on my no-name generic SNES pad from Amazon, the start button still does not do anything.

Is this just a limitation of the controller itself? I don't really know what "SDL" is or means; is it just that some controllers are compatible with it and some are not, or, how does this work? (Just wondering out loud, here, you don't have to teach me "how it works.")

@drfiemost
Copy link
Owner Author

You have to create a mapping using SDL2 Gamepad Mapper, if you're lucky it's already included in the SDL_GameControllerDB
Anyway you need a file with the mapping string for your controller and set the environment variable SDL_GAMECONTROLLERCONFIG to point to that file. (I haven't tried this so YMMV)

The SDL library has its own embedded configuration: https://github.com/libsdl-org/SDL/blob/main/src/joystick/SDL_gamecontrollerdb.h

drfiemost added a commit that referenced this issue Dec 13, 2021
Implement game controller force-feedback support (issue #13)
@drfiemost
Copy link
Owner Author

And now we have force-feedback too!

@s1eve-mcdichae1
Copy link

FF working here 👍

@s1eve-mcdichae1
Copy link

Anyway you need a file with the mapping string for your controller and set the environment variable SDL_GAMECONTROLLERCONFIG to point to that file. (I haven't tried this so YMMV)

Had to use a different tool but I generated a mapping string and set the environment variable, and the cheap Amazon SNES pad works now too!

@drfiemost
Copy link
Owner Author

That's good to hear!
Tried with an xbox controller and it works fine out of the box.
Now we have full features while retaining backward compatibility so this one can be closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants