From cc122ce520c023acc33d85f1c898dcf0ec330a41 Mon Sep 17 00:00:00 2001 From: Gabriel Jacobo Date: Thu, 22 Aug 2013 10:22:22 -0300 Subject: [PATCH] Fixes #2036 and #2038, bypass camera zoom and shutter keypresses on Android. --- android-project/src/org/libsdl/app/SDLActivity.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/android-project/src/org/libsdl/app/SDLActivity.java b/android-project/src/org/libsdl/app/SDLActivity.java index f17365339..52e48e236 100644 --- a/android-project/src/org/libsdl/app/SDLActivity.java +++ b/android-project/src/org/libsdl/app/SDLActivity.java @@ -122,9 +122,13 @@ public class SDLActivity extends Activity { @Override public boolean dispatchKeyEvent(KeyEvent event) { int keyCode = event.getKeyCode(); - // Ignore volume keys so they're handled by Android + // Ignore certain special keys so they're handled by Android if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN || - keyCode == KeyEvent.KEYCODE_VOLUME_UP) { + keyCode == KeyEvent.KEYCODE_VOLUME_UP || + keyCode == KeyEvent.KEYCODE_CAMERA || + keyCode == 168 || /* API 11: KeyEvent.KEYCODE_ZOOM_IN */ + keyCode == 169 /* API 11: KeyEvent.KEYCODE_ZOOM_OUT */ + ) { return false; } return super.dispatchKeyEvent(event);