fixed compilation error for SDL 1.2 target
[rocksndiamonds.git] / src / events.c
index 036f8a0772191fc69f61b36f5abc6cedcd01db8d..37d7c0d72b05b7ef907324589db997b353d54312 100644 (file)
@@ -164,7 +164,7 @@ boolean NextValidEvent(Event *event)
   return FALSE;
 }
 
-void HandleEvents(void)
+static void HandleEvents(void)
 {
   Event event;
   unsigned int event_frame_delay = 0;
@@ -283,7 +283,7 @@ void HandleOtherEvents(Event *event)
   }
 }
 
-void HandleMouseCursor(void)
+static void HandleMouseCursor(void)
 {
   if (game_status == GAME_MODE_TITLE)
   {
@@ -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)
@@ -394,7 +396,7 @@ void ClearEventQueue(void)
   }
 }
 
-void ClearPlayerMouseAction(void)
+static void ClearPlayerMouseAction(void)
 {
   local_player->mouse_action.lx = 0;
   local_player->mouse_action.ly = 0;
@@ -414,7 +416,7 @@ void ClearPlayerAction(void)
   ClearPlayerMouseAction();
 }
 
-void SetPlayerMouseAction(int mx, int my, int button)
+static void SetPlayerMouseAction(int mx, int my, int button)
 {
   int lx = getLevelFromScreenX(mx);
   int ly = getLevelFromScreenY(my);
@@ -693,7 +695,7 @@ static struct
   Key key;
 } touch_info[NUM_TOUCH_FINGERS];
 
-void HandleFingerEvent_VirtualButtons(FingerEvent *event)
+static void HandleFingerEvent_VirtualButtons(FingerEvent *event)
 {
 #if 1
   int x = event->x * overlay.grid_xsize;
@@ -853,7 +855,7 @@ void HandleFingerEvent_VirtualButtons(FingerEvent *event)
   }
 }
 
-void HandleFingerEvent_WipeGestures(FingerEvent *event)
+static void HandleFingerEvent_WipeGestures(FingerEvent *event)
 {
   static Key motion_key_x = KSYM_UNDEFINED;
   static Key motion_key_y = KSYM_UNDEFINED;
@@ -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)