fixed compilation error for SDL 1.2 target
[rocksndiamonds.git] / src / events.c
index 417d149bc0d47feb4133f377224b1d615b647cf0..37d7c0d72b05b7ef907324589db997b353d54312 100644 (file)
@@ -349,6 +349,7 @@ void EventLoop(void)
 
 void ClearAutoRepeatKeyEvents(void)
 {
+#if defined(TARGET_SDL2)
   while (PendingEvent())
   {
     Event next_event;
@@ -362,6 +363,7 @@ void ClearAutoRepeatKeyEvents(void)
     else
       break;
   }
+#endif
 }
 
 void ClearEventQueue(void)
@@ -2113,6 +2115,10 @@ void HandleKey(Key key, int key_status)
     case GAME_MODE_SETUP:
     case GAME_MODE_INFO:
     case GAME_MODE_SCORES:
+
+      if (anyTextGadgetActiveOrJustFinished && key != KSYM_Escape)
+       break;
+
       switch (key)
       {
        case KSYM_space:
@@ -2393,6 +2399,9 @@ void HandleJoystick(void)
     case GAME_MODE_INFO:
     case GAME_MODE_SCORES:
     {
+      if (anyTextGadgetActive())
+       break;
+
       if (game_status == GAME_MODE_TITLE)
        HandleTitleScreen(0,0,dx,dy, newbutton ? MB_MENU_CHOICE : MB_MENU_MARK);
       else if (game_status == GAME_MODE_MAIN)