Fix volume and back keys on android
This commit is contained in:
@@ -1652,7 +1652,7 @@ void Stage::HandleEvent(Event &inEvent)
|
|||||||
mFocusObject->OnKey(inEvent);
|
mFocusObject->OnKey(inEvent);
|
||||||
#ifdef ANDROID
|
#ifdef ANDROID
|
||||||
// Non-cancelled back key ...
|
// Non-cancelled back key ...
|
||||||
if (inEvent.result==0 && inEvent.code==27 && inEvent.type == etKeyUp)
|
if (inEvent.result==0 && inEvent.value==27 && inEvent.type == etKeyUp)
|
||||||
{
|
{
|
||||||
StopAnimation();
|
StopAnimation();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -593,8 +593,15 @@ class MainView extends GLSurfaceView {
|
|||||||
case KeyEvent.KEYCODE_MENU: return 0x01000012; /* Fake MENU */
|
case KeyEvent.KEYCODE_MENU: return 0x01000012; /* Fake MENU */
|
||||||
case KeyEvent.KEYCODE_DEL: return 8;
|
case KeyEvent.KEYCODE_DEL: return 8;
|
||||||
|
|
||||||
|
// These will be ignored by the app and passed to the default handler
|
||||||
|
case KeyEvent.KEYCODE_VOLUME_UP:
|
||||||
|
case KeyEvent.KEYCODE_VOLUME_DOWN:
|
||||||
|
case KeyEvent.KEYCODE_VOLUME_MUTE:
|
||||||
|
return 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (inCode >= 7 && inCode <= 16) {
|
if (inCode >= 7 && inCode <= 16) {
|
||||||
|
|
||||||
return inCode + 41; // 1-9
|
return inCode + 41; // 1-9
|
||||||
|
|||||||
Reference in New Issue
Block a user