When checking key events for triggering global animations, all keys
that are not handled as "click" events for the "any" animation event
were effectively treated like a "released button" event, which did
not have an effect if no mouse button was pressed at the same time.
However, when clicking on "clickable" global animations (those that
have a "click" animation event defined) with key event actions (that
will cause a simulated key press and release event), any key press
event that is not recognized as a "click" event will again be treated
like a "released button" event, causing the "button is pressed" state
in "HandleGlobalAnimClicks()" to be changed to "not pressed anymore",
so the still pressed mouse button will cause another "press event" in
"HandleGlobalAnimClicks()" right away, which will result in multiple
key events instead of one single key event. This may cause unexpected
and unwanted behaviour when handling global animation events.
This problem is fixed by only handling those key events for global
animations that will be handled as "click" events.
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