mirror of
https://github.com/libretro/RetroArch
synced 2025-02-22 12:40:09 +00:00
Rewrite quit key handling
This commit is contained in:
parent
24c7bcb196
commit
d08b785f9d
14
retroarch.c
14
retroarch.c
@ -2314,7 +2314,16 @@ static enum runloop_state runloop_check_state(
|
||||
}
|
||||
#endif
|
||||
|
||||
if (time_to_exit(runloop_cmd_press(trigger_input, RARCH_QUIT_KEY)))
|
||||
/* Check quit key */
|
||||
{
|
||||
static bool old_quit_key = false;
|
||||
bool quit_key = runloop_cmd_press(
|
||||
current_input, RARCH_QUIT_KEY);
|
||||
bool trig_quit_key = quit_key && !old_quit_key;
|
||||
|
||||
old_quit_key = quit_key;
|
||||
|
||||
if (time_to_exit(trig_quit_key))
|
||||
{
|
||||
if (runloop_exec)
|
||||
runloop_exec = false;
|
||||
@ -2330,6 +2339,7 @@ static enum runloop_state runloop_check_state(
|
||||
|
||||
if (!task_push_start_dummy_core(&content_info))
|
||||
{
|
||||
old_quit_key = quit_key;
|
||||
retroarch_main_quit();
|
||||
return RUNLOOP_STATE_QUIT;
|
||||
}
|
||||
@ -2341,10 +2351,12 @@ static enum runloop_state runloop_check_state(
|
||||
}
|
||||
else
|
||||
{
|
||||
old_quit_key = quit_key;
|
||||
retroarch_main_quit();
|
||||
return RUNLOOP_STATE_QUIT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
if (menu_is_alive)
|
||||
|
Loading…
x
Reference in New Issue
Block a user