Fixed key down closing messagebox dialog instead of key up on Android.
authorPhilipp Wiesemann <philipp.wiesemann@arcor.de>
Sun, 14 Sep 2014 19:44:53 +0200
changeset 9142 5bf21e9e191f
parent 9141 8a6af8841969
child 9143 b664273a455c
Fixed key down closing messagebox dialog instead of key up on Android. This fixed sending key up event to SDL a dialog closed by down did not consume.
android-project/src/org/libsdl/app/SDLActivity.java
--- a/android-project/src/org/libsdl/app/SDLActivity.java	Sun Sep 14 13:10:21 2014 -0400
+++ b/android-project/src/org/libsdl/app/SDLActivity.java	Sun Sep 14 19:44:53 2014 +0200
@@ -771,8 +771,10 @@
             public boolean onKey(DialogInterface d, int keyCode, KeyEvent event) {
                 Button button = mapping.get(keyCode);
                 if (button != null) {
-                    button.performClick();
-                    return true;
+                    if (event.getAction() == KeyEvent.ACTION_UP) {
+                        button.performClick();
+                    }
+                    return true; // also for ignored actions
                 }
                 return false;
             }