Browse Source

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.
Philipp Wiesemann 10 years ago
parent
commit
0fbd904af8
1 changed files with 4 additions and 2 deletions
  1. 4 2
      android-project/src/org/libsdl/app/SDLActivity.java

+ 4 - 2
android-project/src/org/libsdl/app/SDLActivity.java

@@ -771,8 +771,10 @@ public class SDLActivity extends Activity {
             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;
             }