Rewrite quit key handling

This commit is contained in:
twinaphex 2017-05-21 13:50:59 +02:00
parent 24c7bcb196
commit d08b785f9d

View File

@ -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)