Fixes #2036 and #2038, bypass camera zoom and shutter keypresses on Android.

This commit is contained in:
Gabriel Jacobo 2013-08-22 10:22:22 -03:00
parent cd27a1ef05
commit cc122ce520
1 changed files with 6 additions and 2 deletions

View File

@ -122,9 +122,13 @@ public class SDLActivity extends Activity {
@Override @Override
public boolean dispatchKeyEvent(KeyEvent event) { public boolean dispatchKeyEvent(KeyEvent event) {
int keyCode = event.getKeyCode(); 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 || 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 false;
} }
return super.dispatchKeyEvent(event); return super.dispatchKeyEvent(event);