mirror of
https://github.com/libretro/RetroArch.git
synced 2025-01-22 09:15:02 +00:00
(Android) Implement all back behaviors
This commit is contained in:
parent
ab735cb307
commit
a7b34ec794
@ -1698,7 +1698,23 @@ static void android_input_poll(void *data)
|
||||
&& input_state > 0)
|
||||
{
|
||||
}
|
||||
else if (android->onBackPressed)
|
||||
else if (g_settings.input.back_behavior == BACK_BUTTON_QUIT)
|
||||
{
|
||||
*lifecycle_state |= (1ULL << RARCH_QUIT_KEY);
|
||||
AInputQueue_finishEvent(android_app->inputQueue, event, handled);
|
||||
break;
|
||||
}
|
||||
else if (g_settings.input.back_behavior == BACK_BUTTON_GUI_TOGGLE)
|
||||
{
|
||||
int action = AKeyEvent_getAction(event);
|
||||
if (action == AKEY_EVENT_ACTION_DOWN)
|
||||
*lifecycle_state |= (1ULL << RARCH_MENU_TOGGLE);
|
||||
else if (action == AKEY_EVENT_ACTION_UP)
|
||||
*lifecycle_state &= ~(1ULL << RARCH_MENU_TOGGLE);
|
||||
AInputQueue_finishEvent(android_app->inputQueue, event, handled);
|
||||
break;
|
||||
}
|
||||
else if (android->onBackPressed && g_settings.input.back_behavior == BACK_BUTTON_MENU_TOGGLE)
|
||||
{
|
||||
RARCH_LOG("Invoke onBackPressed through JNI.\n");
|
||||
JNIEnv *env = jni_thread_getenv();
|
||||
|
@ -2,12 +2,14 @@
|
||||
<resources>
|
||||
<string-array name="back_options" translatable="false">
|
||||
<item>@string/quit</item>
|
||||
<item>@string/gui_toggle</item>
|
||||
<item>@string/menu_toggle</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="back_options_values" translatable="false">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="audio_latency_options" translatable="false">
|
||||
|
@ -85,6 +85,7 @@
|
||||
|
||||
<!-- Back Options -->
|
||||
<string name="quit">Quit</string>
|
||||
<string name="gui_toggle">GUI toggle</string>
|
||||
<string name="menu_toggle">Menu toggle</string>
|
||||
|
||||
<!-- Audio Settings -->
|
||||
|
@ -54,6 +54,7 @@ bool input_translate_coord_viewport(int mouse_x, int mouse_y,
|
||||
enum back_button_enums
|
||||
{
|
||||
BACK_BUTTON_QUIT = 0,
|
||||
BACK_BUTTON_GUI_TOGGLE,
|
||||
BACK_BUTTON_MENU_TOGGLE,
|
||||
};
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user