fixed handling global animation key event actions multiple times
[rocksndiamonds.git] / src / events.c
index 9966905b6286a496ee0a97868b2990105d6dc98a..11fd28f40035daab17fc49caf6e05a0995b8262c 100644 (file)
@@ -2145,9 +2145,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