Discussion:
[SDL] Game Controller Map app
GameCodingNinja
2016-10-21 16:17:45 UTC
Permalink
I picked up a Mad Catz GameSmart C.T.R.L controller for my Android phone (Samsung Galaxy S7 Edge) and noticed it didn't work in my SDL game. The gamecontrollerdb.txt doesn't have entries for Android entries and my game only responds to the Game Controller messages. I built the controllermap.c with the androidbuild.sh but when it runs, it only displays a white screen.

I'm surprised the gamecontrollerdb.txt doesn't have any Android entries. Not sure what to do at this point.
Triang3l
2016-10-22 21:39:23 UTC
Permalink
The Android code for gamepads in SDL needs to be rewritten from scratch, it simply ignores the fact that the system already provides a unified mapping for gamepads and just assigns consecutive numbers to whatever axes/buttons are physically available instead, and SDL doesn't need a mapping table at all (apart from one global mapping similar to the XInput one on Windows - any deviations only optionally for specific controllers). Also LTRIGGER/RTRIGGER and BRAKE/GAS duality is not taken into account by SDL.
As a quick workaround, you could write some glue code to access the gamepad events natively, bypassing SDL (or by generating custom SDL events). In the future, it needs to be fixed in the upstream.
-------- Original message --------From: GameCodingNinja <***@gmail.com> Date: 10/21/16 19:17 (GMT+03:00) To: ***@lists.libsdl.org Subject: Re: [SDL] Game Controller Map app


I picked up a Mad Catz GameSmart C.T.R.L controller for my Android phone (Samsung Galaxy S7 Edge) and noticed it didn't work in my SDL game. The gamecontrollerdb.txt doesn't have entries for Android entries and my game only responds to the Game Controller messages. I built the controllermap.c with the androidbuild.sh but when it runs, it only displays a white screen.



I'm surprised the gamecontrollerdb.txt doesn't have any Android entries. Not sure what to do at this point.
GameCodingNinja
2016-10-23 16:15:03 UTC
Permalink
So as of now, my game is reporting that there is no controllers connected even though it is and working with other apps.

What I'm confused about is some posts here report that controller support is working in their apps. Are they using a different controller? Version 2.0.4 has Android specific fixes/additions related to the joystick. gamecontrollerdb.txt doesn't have any Android entries but SDL_GameControllerAddMappingsFromFile returns back with 8 new mappings and SDL_NumJoysticks() returns zero.
Loading...