changed using 'external' app data directory on Android version, if possible
[rocksndiamonds.git] / src / events.c
index 20c6e3432e3dff614ea005e59cda0fb70c92a371..6dbb1e7154fd6823a9e5d7ebcfaebbfb9c0830d4 100644 (file)
@@ -1233,7 +1233,11 @@ void HandleButton(int mx, int my, int button, int button_nr)
   }
 #endif
 
-  HandleGlobalAnimClicks(mx, my, button);
+  if (HandleGlobalAnimClicks(mx, my, button))
+  {
+    /* do not handle this button event anymore */
+    mx = my = -32;     /* force mouse event to be outside screen tiles */
+  }
 
   if (button_hold && game_status == GAME_MODE_PLAYING && tape.pausing)
     return;
@@ -1699,6 +1703,15 @@ void HandleKey(Key key, int key_status)
     return;
   }
 
+  if (HandleGlobalAnimClicks(-1, -1, (key == KSYM_space ||
+                                     key == KSYM_Return ||
+                                     key == KSYM_Escape)))
+  {
+    /* do not handle this key event anymore */
+    if (key != KSYM_Escape)    /* always allow ESC key to be handled */
+      return;
+  }
+
   if (game_status == GAME_MODE_PLAYING && AllPlayersGone &&
       (key == KSYM_Return || key == setup.shortcut.toggle_pause))
   {
@@ -1953,6 +1966,12 @@ void HandleJoystick()
   int dx       = (left ? -1    : right ? 1     : 0);
   int dy       = (up   ? -1    : down  ? 1     : 0);
 
+  if (HandleGlobalAnimClicks(-1, -1, newbutton))
+  {
+    /* do not handle this button event anymore */
+    return;
+  }
+
   switch (game_status)
   {
     case GAME_MODE_TITLE: