(Android) Ability to use AKEYCODE_BACK for pads

This commit is contained in:
twinaphex 2013-02-13 17:55:49 +01:00
parent 2aecc0e5f5
commit 19fae3f52f

View File

@ -132,14 +132,24 @@ static void android_input_poll(void *data)
long_msg_enable = true;
}
if (keycode == AKEYCODE_BACK )
if (keycode == AKEYCODE_BACK)
{
int meta = AKeyEvent_getMetaState(event);
if (!(meta & AMETA_ALT_ON))
uint8_t unpacked = (keycode_lut[AKEYCODE_BACK] >> ((state_id+1) << 3)) - 1;
uint64_t input_state = (1ULL << unpacked);
if (type_event == AINPUT_EVENT_TYPE_KEY && input_state < (1ULL << RARCH_FIRST_META_KEY)
&& input_state > 0)
{
*lifecycle_state |= (1ULL << RARCH_QUIT_KEY);
AInputQueue_finishEvent(android_app->inputQueue, event, handled);
break;
}
else
{
int meta = AKeyEvent_getMetaState(event);
if (!(meta & AMETA_ALT_ON))
{
*lifecycle_state |= (1ULL << RARCH_QUIT_KEY);
AInputQueue_finishEvent(android_app->inputQueue, event, handled);
break;
}
}
}