Browse Source

Eat Android Back key to avoid crash

pull/69/head
raysan5 9 years ago
parent
commit
802f29fb0e
1 changed files with 6 additions and 10 deletions
  1. +6
    -10
      src/gestures.c

+ 6
- 10
src/gestures.c View File

@ -534,20 +534,16 @@ static int32_t AndroidInputCallback(struct android_app *app, AInputEvent *event)
} }
else if (type == AINPUT_EVENT_TYPE_KEY) else if (type == AINPUT_EVENT_TYPE_KEY)
{ {
//int32_t key = AKeyEvent_getKeyCode(event); int32_t keycode = AKeyEvent_getKeyCode(event);
//int32_t AKeyEvent_getMetaState(event); int32_t AKeyEvent_getMetaState(event);
//int32_t code = AKeyEvent_getKeyCode((const AInputEvent *)event);
// If we are in active mode, we eat the back button and move into pause mode. // If we are in active mode, we eat the back button and move into pause mode.
// If we are already in pause mode, we allow the back button to be handled by the OS, which means we'll be shut down. // If we are already in pause mode, we allow the back button to be handled by the OS, which means we'll be shut down.
/* if ((keycode == AKEYCODE_BACK)) // && mActiveMode)
if ((code == AKEYCODE_BACK) && mActiveMode)
{ {
setActiveMode(false); o">//setActiveMode(false);
return 1; o">//return 1;
} }
*/
} }
int32_t action = AMotionEvent_getAction(event); int32_t action = AMotionEvent_getAction(event);

||||||
x
 
000:0
Loading…
Cancel
Save