static unsigned int special_cursor_delay_value = 1000;
static boolean virtual_button_pressed = FALSE;
+static boolean stop_processing_events = FALSE;
// forward declarations for internal use
int FilterMouseMotionEvents(void *userdata, Event *event)
{
- if (event->type != EVENT_MOTIONNOTIFY)
- return 1;
-
- int mouse_x = ((MotionEvent *)event)->x;
- int mouse_y = ((MotionEvent *)event)->y;
-
- // mouse events do not contain logical screen size corrections at this stage
- SDLCorrectMouseEventXY(&mouse_x, &mouse_y);
-
- mouse_x -= video.screen_xoffset;
- mouse_y -= video.screen_yoffset;
+ if (event->type == EVENT_MOTIONNOTIFY)
+ {
+ int mouse_x = ((MotionEvent *)event)->x;
+ int mouse_y = ((MotionEvent *)event)->y;
- gfx.mouse_x = mouse_x;
- gfx.mouse_y = mouse_y;
+ UpdateRawMousePosition(mouse_x, mouse_y);
+ }
return 1;
}
return FALSE;
}
+void StopProcessingEvents(void)
+{
+ stop_processing_events = TRUE;
+}
+
static void HandleEvents(void)
{
Event event;
ResetDelayCounter(&event_frame_delay);
+ stop_processing_events = FALSE;
+
while (NextValidEvent(&event))
{
switch (event.type)
// do not handle events for longer than standard frame delay period
if (DelayReached(&event_frame_delay, event_frame_delay_value))
break;
+
+ // do not handle any further events if triggered by a special flag
+ if (stop_processing_events)
+ break;
}
}
if (game_status == GAME_MODE_SETUP)
RedrawSetupScreenAfterFullscreenToggle();
+ UpdateMousePosition();
+
SetWindowTitle();
}
}
if (game_status == GAME_MODE_SETUP)
RedrawSetupScreenAfterFullscreenToggle();
+ UpdateMousePosition();
+
// set flag to ignore repeated "key pressed" events
ignore_repeated_key = TRUE;
if (game_status == GAME_MODE_SETUP)
RedrawSetupScreenAfterFullscreenToggle();
+ UpdateMousePosition();
+
return;
}