SDL/android-project
Sam Lantinga ae8ca7c54d Fixed bug 3444 - Android-TV: no more handling of back button on remote
ny00

Unfortunately, simply checking the return codes of "onNativePadDown/Up" as previously done has its own issue:

If an SDL joystick is connected *and* opened, then a proper KeyEvent, say with keycode KEYCODE_BUTTON_1, should lead to an SDL joystick button event as expected.

If, however, the joystick was *not* opened, then "onNativePadDown/Up" will return a negative value, so before the commit from bug 3426, you could unexpectedly get a keyboard event. (In practice, you'll just get a log message, since KEYCODE_BUTTON_1 has no mapping to a proper SDL_ScanCode value, but it's still an problem).

What should still be done, though, is checking the key code itself. We do have the KeyEvent.isGamepadButton method, but according my test, it returns "true" exactly (and only) for the KEYCODE_BUTTON* values, and not for KEYCODE_DPAD* or any other key code.

Here is a possible solution:
- Do check the return codes of "onNativePadDown/Up" as previously done.
- In addition, in "Android_OnPadDown/Up" from src/joystick/android/SDL_sysjoystick.c, 0 should *always* be returned in case the key code can be translated to an SDL_joystick button; Even if no matching joystick can be found.
2016-10-17 22:09:22 -07:00
..
jni Fixed bug 2758 - Android issues with NDK r10c and API-21 2016-10-14 06:57:55 -07:00
res Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 17:33:46 +02:00
src/org/libsdl/app Fixed bug 3444 - Android-TV: no more handling of back button on remote 2016-10-17 22:09:22 -07:00
AndroidManifest.xml android: implement audio capture support. 2016-08-11 22:04:49 -04:00
ant.properties Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 17:33:46 +02:00
build.properties Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 17:33:46 +02:00
build.xml Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 17:33:46 +02:00
default.properties Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 17:33:46 +02:00
proguard-project.txt Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 17:33:46 +02:00
project.properties Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 17:33:46 +02:00