Fixes #2036 and #2038, bypass camera zoom and shutter keypresses on Android.
authorGabriel Jacobo <gabomdq@gmail.com>
Thu, 22 Aug 2013 10:22:22 -0300
changeset 7687 eb769105631b
parent 7686 adacc93b5213
child 7688 00042bf02d17
Fixes #2036 and #2038, bypass camera zoom and shutter keypresses on Android.
android-project/src/org/libsdl/app/SDLActivity.java
--- a/android-project/src/org/libsdl/app/SDLActivity.java	Wed Aug 21 12:12:04 2013 -0700
+++ b/android-project/src/org/libsdl/app/SDLActivity.java	Thu Aug 22 10:22:22 2013 -0300
@@ -122,9 +122,13 @@
     @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);