Skip to content
Snippets Groups Projects
Commit 41e9c20c authored by Monster Iestyn's avatar Monster Iestyn
Browse files

Ignore mouse button events if the mouse's focus is not actually on the window at the moment.

This should hopefully kill the F12 getting stuck issue once and for all.
parent 8e5ac64d
No related branches found
No related tags found
No related merge requests found
......@@ -658,6 +658,14 @@ static void Impl_HandleMouseButtonEvent(SDL_MouseButtonEvent evt, Uint32 type)
SDL_memset(&event, 0, sizeof(event_t));
// Ignore the event if the mouse is not actually focused on the window.
// This can happen if you used the mouse to restore keyboard focus;
// this apparently makes a mouse button down event but not a mouse button up event,
// resulting in whatever key was pressed down getting "stuck" if we don't ignore it.
// -- Monster Iestyn (28/05/18)
if (SDL_GetMouseFocus() != window)
return;
/// \todo inputEvent.button.which
if (USE_MOUSEINPUT)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment