mirror of
https://github.com/yawut/SDL.git
synced 2026-04-16 13:55:53 -05:00
Fixed bug 1569 - Android volume keys not honoured inside SDL
Joseba García Echebarria The current version of SDL HG in Android doesn't do anything when volume keys are pressed. The change makes SDL ignore volume keys so that they're handled by the OS and the sound volume can be changed within an app.
This commit is contained in:
parent
5c921db1f1
commit
c7dfdbb52f
|
|
@ -711,6 +711,12 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
|
|||
@Override
|
||||
public boolean onKey(View v, int keyCode, KeyEvent event) {
|
||||
|
||||
// Ignore volume keys so they're handled by Android
|
||||
if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN ||
|
||||
keyCode == KeyEvent.KEYCODE_VOLUME_UP) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||
//Log.v("SDL", "key down: " + keyCode);
|
||||
SDLActivity.onNativeKeyDown(keyCode);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user