key = event.key.keysym.sym;
+ /* Check for menu-events, if the menu is shown */
+ if(show_menu)
+ menu_event(key);
+
if (key == SDLK_ESCAPE)
{
/* Escape: Open/Close the menu: */
key = event.key.keysym.sym;
- /* Check for menu-events, if the menu is shown */
- if(show_menu)
- menu_event(key);
-
if (key == SDLK_RIGHT)
{
right = UP;
key = event.key.keysym.sym;
+ /* Check for menu events */
+ menu_event(key);
+
if (key == SDLK_ESCAPE)
{
/* Escape: Quit: */
quit = 1;
}
}
- else if (event.type == SDL_KEYUP)
- {
- key = event.key.keysym.sym;
- /* Check for menu events */
- menu_event(key);
- }
#ifdef JOY_YES
else if (event.type == SDL_JOYAXISMOTION)
{