When handling key actions for global animations (like pressing "Enter"
or "Escape") which are translated into global animation click events,
they were ignored if a "real" mouse button is already held pressed at
the same time. This can especially happen with animation event actions
that simulate key press events when clicking on global animations, so
the key actions were ignored if the mouse button was held down for too
long.
This change forces key actions of global animations to be handled even
if a mouse button was pressed at the same time.
InitGlobalAnim_Clicked(-1, -1, ANIM_CLICKED_RESET);
}
InitGlobalAnim_Clicked(-1, -1, ANIM_CLICKED_RESET);
}
-boolean HandleGlobalAnimClicks(int mx, int my, int button)
+boolean HandleGlobalAnimClicks(int mx, int my, int button, boolean force_click)
{
static boolean click_consumed = FALSE;
static int last_button = 0;
{
static boolean click_consumed = FALSE;
static int last_button = 0;
boolean release_event;
boolean click_consumed_current = click_consumed;
boolean release_event;
boolean click_consumed_current = click_consumed;
+ if (button != 0 && force_click)
+ last_button = 0;
+
// check if button state has changed since last invocation
press_event = (button != 0 && last_button == 0);
release_event = (button == 0 && last_button != 0);
// check if button state has changed since last invocation
press_event = (button != 0 && last_button == 0);
release_event = (button == 0 && last_button != 0);
void InitGlobalAnimations(void);
void DrawGlobalAnimations(int, int);
void InitGlobalAnimations(void);
void DrawGlobalAnimations(int, int);
-boolean HandleGlobalAnimClicks(int, int, int);
+boolean HandleGlobalAnimClicks(int, int, int, boolean);
!virtual_button_pressed));
#endif
!virtual_button_pressed));
#endif
- if (HandleGlobalAnimClicks(mx, my, button))
+ if (HandleGlobalAnimClicks(mx, my, button, FALSE))
{
// do not handle this button event anymore
return; // force mouse event not to be handled at all
{
// do not handle this button event anymore
return; // force mouse event not to be handled at all
if (HandleGlobalAnimClicks(-1, -1, (key == KSYM_space ||
key == KSYM_Return ||
if (HandleGlobalAnimClicks(-1, -1, (key == KSYM_space ||
key == KSYM_Return ||
+ key == KSYM_Escape), TRUE))
{
// do not handle this key event anymore
if (key != KSYM_Escape) // always allow ESC key to be handled
{
// do not handle this key event anymore
if (key != KSYM_Escape) // always allow ESC key to be handled
int dy = (up ? -1 : down ? 1 : 0);
boolean use_delay_value_first = (joytest != joytest_last);
int dy = (up ? -1 : down ? 1 : 0);
boolean use_delay_value_first = (joytest != joytest_last);
- if (HandleGlobalAnimClicks(-1, -1, newbutton))
+ if (HandleGlobalAnimClicks(-1, -1, newbutton, FALSE))
{
// do not handle this button event anymore
return;
{
// do not handle this button event anymore
return;