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
Support standard layout on Android #2557
Labels
Milestone
Comments
Also, what makes this actually more important, it's sadly rather hard to actually make one's own SDL_gamecontrollerdb entry for Android, as IIRC no tools are available to build them. |
divVerent
added a commit
to divVerent/ebiten
that referenced
this issue
Mar 11, 2023
This commit mirrors libsdl-org/SDL#7405 (libsdl-org/SDL@6f1f586). Note that for SDL, this code is used a lot less than for Ebitengine, as SDL mostly migrated to HIDAPI and direct USB device access rather than using Android's APIs. For Bluetooth devices, however, the Java APIs are used the same way. This was the remaining problem to be solved to automatically support standard layout on most standard gamepads (this should cover most Xbox-ish and PS-ish gamepads on the market). In particular this covers gamepads with the following assignment: - Left stick = X/Y, right stick = Z/RZ, triggers = LEFTTRIGGER/RIGHTTRIGGER (which basically is what Android docs say and some PS gamepads do) - Left stick = X/Y, right stick = RX/RY, triggers = Z/RZ (Xbox gamepad style, apparently) - Left stick = X/Y, right stick = RX/RY, triggers = LEFTTRIGGER/RIGHTTRIGGER (Not sure if this exists, but it's conceivable) As we found on the SDL pull request discussion, gamepads that offer flight controls (e.g. THROTTLE and RUDDER) will likely not work well, before and after this change. Fixes hajimehoshi#2557
hajimehoshi
pushed a commit
that referenced
this issue
Mar 12, 2023
This commit mirrors libsdl-org/SDL#7405 (libsdl-org/SDL@6f1f586). Note that for SDL, this code is used a lot less than for Ebitengine, as SDL mostly migrated to HIDAPI and direct USB device access rather than using Android's APIs. For Bluetooth devices, however, the Java APIs are used the same way. This was the remaining problem to be solved to automatically support standard layout on most standard gamepads (this should cover most Xbox-ish and PS-ish gamepads on the market). In particular this covers gamepads with the following assignment: - Left stick = X/Y, right stick = Z/RZ, triggers = LEFTTRIGGER/RIGHTTRIGGER (which basically is what Android docs say and some PS gamepads do) - Left stick = X/Y, right stick = RX/RY, triggers = Z/RZ (Xbox gamepad style, apparently) - Left stick = X/Y, right stick = RX/RY, triggers = LEFTTRIGGER/RIGHTTRIGGER (Not sure if this exists, but it's conceivable) As we found on the SDL pull request discussion, gamepads that offer flight controls (e.g. THROTTLE and RUDDER) will likely not work well, before and after this change. Closes #2557
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Operating System
What feature would you like to be added?
IsStandardGamepadLayoutSupported should be implemented for Android
Why is this needed?
SDL_GameControllerDB is far from complete for Android, and also Android already provides its own mostly correct mappings. Buttons and axes already are named similar to Linux standard layout ones.
This issue is similar to #2052 in that the solution is very similar. It appears like Android even uses the same axis/button constant naming as the Linux kernel itself, even though the documentation seems to swap ABS_RX/ABS_Z and ABS_RY/ABS_RZ between the two (but based on my sample size of ONE game pad, it's not actually swapped in the implementation).
The text was updated successfully, but these errors were encountered: