sdlwindow: get mod from key event

No need to call SDL_GetModState, the event already carries this
information.
This commit is contained in:
Simon Ser 2021-09-14 18:23:30 +02:00
parent e5faeaed68
commit 0d43e3472a

View file

@ -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 )