The "original" Escape key behaviour meant here is "exit no questions
asked". The implementation is actually "wrong", based on the fact
that the game converts Escape key presses to joystick "exit" button
events. Thus, the "pause key is not Escape" test is performed in the
state buttn handler when in fact we have no idea where the button
event came from. However, the resulting behaviour believed to be
identical to that in 1.4.0 for both keyboard and joystick.
git-svn-id: https://s.snth.net/svn/neverball/trunk@2081
78b8d119-cf0a-0410-b17c-
f493084dd1d7
{
if (config_tst_d(CONFIG_JOYSTICK_BUTTON_EXIT, b))
{
- if (!(SDL_GetModState() & KMOD_SHIFT))
+ if (config_tst_d(CONFIG_KEY_PAUSE, SDLK_ESCAPE))
demo_paused = 1;
+
return goto_state(&st_demo_end);
}
}
{
if (config_tst_d(CONFIG_JOYSTICK_BUTTON_A, b))
return demo_end_action(gui_token(gui_click()));
+
if (config_tst_d(CONFIG_JOYSTICK_BUTTON_EXIT, b))
{
if (demo_paused)
return pause_action(gui_token(gui_click()));
if (config_tst_d(CONFIG_JOYSTICK_BUTTON_EXIT, b))
- {
- if (SDL_GetModState() & KMOD_SHIFT)
- return pause_action(PAUSE_EXIT);
- else
- return pause_action(PAUSE_CONTINUE);
- }
+ return pause_action(PAUSE_CONTINUE);
}
return 1;
}
static int pause_or_exit(void)
{
- if (SDL_GetModState() & KMOD_SHIFT)
+ if (config_tst_d(CONFIG_KEY_PAUSE, SDLK_ESCAPE))
+ {
+ return goto_pause();
+ }
+ else
{
progress_stat(GAME_NONE);
progress_stop();
+
config_clr_grab();
return goto_state(&st_over);
}
- return goto_pause();
}
/*---------------------------------------------------------------------------*/
if (curr_state() == &st_pause)
return 1;
- if (e && (SDL_GetModState() & KMOD_SHIFT))
+ if (e && !config_tst_d(CONFIG_KEY_PAUSE, SDLK_ESCAPE))
return goto_state(s);
st_continue = curr_state();
{
if (d)
{
- if (c == SDLK_ESCAPE)
- return goto_pause(&st_over, 1);
if (config_tst_d(CONFIG_KEY_PAUSE, c))
return goto_pause(&st_over, 0);
}