Fixes #2036 and #2038, bypass camera zoom and shutter keypresses on Android.
authorGabriel Jacobo
Thu, 22 Aug 2013 10:22:22 -0300
changeset 7687eb769105631b
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
     1.1 --- a/android-project/src/org/libsdl/app/SDLActivity.java	Wed Aug 21 12:12:04 2013 -0700
     1.2 +++ b/android-project/src/org/libsdl/app/SDLActivity.java	Thu Aug 22 10:22:22 2013 -0300
     1.3 @@ -122,9 +122,13 @@
     1.4      @Override
     1.5      public boolean dispatchKeyEvent(KeyEvent event) {
     1.6          int keyCode = event.getKeyCode();
     1.7 -        // Ignore volume keys so they're handled by Android
     1.8 +        // Ignore certain special keys so they're handled by Android
     1.9          if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN ||
    1.10 -            keyCode == KeyEvent.KEYCODE_VOLUME_UP) {
    1.11 +            keyCode == KeyEvent.KEYCODE_VOLUME_UP ||
    1.12 +            keyCode == KeyEvent.KEYCODE_CAMERA ||
    1.13 +            keyCode == 168 || /* API 11: KeyEvent.KEYCODE_ZOOM_IN */
    1.14 +            keyCode == 169 /* API 11: KeyEvent.KEYCODE_ZOOM_OUT */
    1.15 +            ) {
    1.16              return false;
    1.17          }
    1.18          return super.dispatchKeyEvent(event);