1
0
forked from mirrors/0ad

Created hotkey to grab and release mouse.

Addresses #6790
This commit is contained in:
scuti
2025-01-26 11:24:43 -08:00
committed by Ralph Sennhauser
parent a786a1f3d8
commit a9819e9865
3 changed files with 11 additions and 0 deletions
+6
View File
@@ -244,6 +244,12 @@ static InReaction MainInputHandler(const SDL_Event_* ev)
g_Profiler2.Toggle();
return IN_HANDLED;
}
else if (hotkey == "mousegrabtoggle")
{
SDL_Window* const window{g_VideoMode.GetWindow()};
const SDL_bool willGrabMouse{SDL_GetWindowGrab(window) ? SDL_FALSE : SDL_TRUE};
SDL_SetWindowGrab(window, willGrabMouse);
}
break;
}