Skip to content

Commit

Permalink
Fixes #2036 and #2038, bypass camera zoom and shutter keypresses on A…
Browse files Browse the repository at this point in the history
…ndroid.
  • Loading branch information
gabomdq committed Aug 22, 2013
1 parent cd27a1e commit cc122ce
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions android-project/src/org/libsdl/app/SDLActivity.java
Expand Up @@ -122,9 +122,13 @@ protected void onDestroy() {
@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);
Expand Down

0 comments on commit cc122ce

Please sign in to comment.