From c4022f466f721a683b364ec18aa0f0433c72350b Mon Sep 17 00:00:00 2001 From: dyharlan Date: Wed, 10 Jul 2024 18:54:05 +0800 Subject: [PATCH] Fix modstate bug preventing mousegrab --- core/hostevents_sdl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/hostevents_sdl.cpp b/core/hostevents_sdl.cpp index 7bccc9b..8ce70fd 100644 --- a/core/hostevents_sdl.cpp +++ b/core/hostevents_sdl.cpp @@ -25,7 +25,7 @@ along with this program. If not, see . #include #include #include - +#include EventManager* EventManager::event_manager; static int get_sdl_event_key_code(const SDL_KeyboardEvent &event); @@ -56,7 +56,7 @@ void EventManager::poll_events() case SDL_KEYUP: { // Internal shortcuts to trigger mouse grab, intentionally not // sent to the host. - if (event.key.keysym.sym == SDLK_g && SDL_GetModState() == KMOD_LCTRL) { + if (SDL_GetModState() & KMOD_LCTRL && event.key.keysym.sym == SDLK_g) { if (event.type == SDL_KEYUP) { toggle_mouse_grab(event.key); }