From 0d43e3472a5229dde88104f8b673968590fdf3e5 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 14 Sep 2021 18:23:30 +0200 Subject: [PATCH] sdlwindow: get mod from key event No need to call SDL_GetModState, the event already carries this information. --- src/sdlwindow.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/sdlwindow.cpp b/src/sdlwindow.cpp index d4a3735..6e0efc7 100644 --- a/src/sdlwindow.cpp +++ b/src/sdlwindow.cpp @@ -65,7 +65,6 @@ void updateOutputRefresh( void ) void inputSDLThreadRun( void ) { SDL_Event event; - SDL_Keymod mod; uint32_t key; g_unSDLUserEventID = SDL_RegisterEvents( 1 ); @@ -130,10 +129,9 @@ void inputSDLThreadRun( void ) break; case SDL_KEYDOWN: case SDL_KEYUP: - mod = SDL_GetModState(); key = SDLScancodeToLinuxKey( event.key.keysym.scancode ); - if ( event.type == SDL_KEYUP && mod & KMOD_LGUI ) + if ( event.type == SDL_KEYUP && ( event.key.keysym.mod & KMOD_LGUI ) ) { bool handled = true; switch ( key )