added global animation actions executed after init/anim/post delay
[rocksndiamonds.git] / src / events.c
index 9966905b6286a496ee0a97868b2990105d6dc98a..3a22c7426f36215175cad6312a68f8bcbe04a230 100644 (file)
@@ -1607,6 +1607,15 @@ void HandleUserEvent(UserEvent *event)
 {
   switch (event->code)
   {
+    case USEREVENT_ANIM_DELAY_ACTION:
+    case USEREVENT_ANIM_EVENT_ACTION:
+      // execute action functions until matching action was found
+      if (DoKeysymAction(event->value1) ||
+         DoGadgetAction(event->value1) ||
+         DoScreenAction(event->value1))
+       return;
+      break;
+
     default:
       break;
   }
@@ -2145,9 +2154,12 @@ void HandleKey(Key key, int key_status)
     return;
   }
 
-  if (HandleGlobalAnimClicks(-1, -1, (key == KSYM_space ||
-                                     key == KSYM_Return ||
-                                     key == KSYM_Escape), TRUE))
+  // some key events are handled like clicks for global animations
+  boolean click = (key == KSYM_space ||
+                  key == KSYM_Return ||
+                  key == KSYM_Escape);
+
+  if (click && HandleGlobalAnimClicks(-1, -1, MB_LEFTBUTTON, TRUE))
   {
     // do not handle this key event anymore
     if (key != KSYM_Escape)    // always allow ESC key to be handled