From 0fbd904af883d7515f4a01fbccc9f8c901629b6d Mon Sep 17 00:00:00 2001 From: Philipp Wiesemann Date: Sun, 14 Sep 2014 19:44:53 +0200 Subject: [PATCH] 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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/android-project/src/org/libsdl/app/SDLActivity.java b/android-project/src/org/libsdl/app/SDLActivity.java index bfbbed528..60bc45f16 100644 --- a/android-project/src/org/libsdl/app/SDLActivity.java +++ b/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; }