mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-11 13:26:34 +00:00
(Android) Ability to use AKEYCODE_BACK for pads
This commit is contained in:
parent
2aecc0e5f5
commit
19fae3f52f
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user