-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
The binding of joystick buttons is different from SDL 1.2 to SDL 2.0 #2193
Comments
To complete my question, here is the binding IDs of each button for a classic Xbox 360 gamepad with SDL 1.2 and SDL 2.0:
|
As far as I can tell, (almost) everything related to SDL ought to be in: /system/include/SDL |
I found a post in relation with my question: http://forums.libsdl.org/viewtopic.php?t=9205 It seems that this problem can be resolved using the new Gamepad API of SDL 2.0. Can we expect a migration of Emscripten from SDL 1.2 to SDL 2.0 ? Is it on the roadmap ? |
Some people have voiced interest in a proper port of SDL 2.0 from source, and I hope this will happen in the near future, but I don't know for sure. You can use the html5.h support in emscripten to get direct access to things like joysticks, might be simpler to just do that. But, proper SDL 2.0 is of course the thing that we want. |
Thx for the advice. We have other problems with the keyboard scancode/keycode which seems to be different between SDL 1.3 and SDL 2.0. The result is that in native we don't have the same keyboard mapping than in emscripten. I think SDL2.0 is largely backward compatible, and we could support SDL2 differences first and then the new features afterward. The keyboard mapping issue is a major issue I think. I want to start by:
But I don't know how to make sure library_sdl2.js will be used when I'm actually trying to link with SDL2. |
I would personally love a port of SDL2; rock on @promethe42! |
If we go this route, we could use SDL2 when But, a bigger question is whether forking the current js file is the way to go. It will mean duplication which could cause us to need to fix bugs in two places. Also, the current js is a small subset of SDL - if we ported SDL2 from source, we would get all of it more easily. I suspect that route is more promising, but I don't know the SDL codebase so I'm not sure. |
I love you Noxalus ;___; |
I'm bouncing into this issue 3.5 years later, because I just searched for "gamepad" and this is still open:
tl;dr: this bug should be closed, imho. Your friendly neighborhood SDL maintainer, |
Agreed on those points, and thanks for the help, finding old bugs to close is great. |
I work on a multiplatform project that use SDL 2.0 for other targets than HTML 5 that use SDL 1.2.
But for a reason I don't know, the value of
event.jbutton.button
(for SDL_JOYBUTTONUP or SDL_JOYBUTTONDOWN) is different between SDL 1.2 and SDL 2.0.Do you know why and where I can found the source code which is causing the problem ?
Thanks in advance.
The text was updated successfully, but these errors were encountered: