mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-30 11:19:51 +02:00
Ignore key events with KMOD_GUI set
As those are probably not meant for us.
This commit is contained in:
@@ -244,12 +244,20 @@ void EventProcess(SDL_Event event)
|
||||
engine->Exit();
|
||||
break;
|
||||
case SDL_KEYDOWN:
|
||||
if (event.key.keysym.mod & KMOD_GUI)
|
||||
{
|
||||
break;
|
||||
}
|
||||
if (!event.key.repeat && event.key.keysym.sym == 'q' && (event.key.keysym.mod&KMOD_CTRL))
|
||||
engine->ConfirmExit();
|
||||
else
|
||||
engine->onKeyPress(event.key.keysym.sym, event.key.keysym.scancode, event.key.repeat, event.key.keysym.mod&KMOD_SHIFT, event.key.keysym.mod&KMOD_CTRL, event.key.keysym.mod&KMOD_ALT);
|
||||
break;
|
||||
case SDL_KEYUP:
|
||||
if (event.key.keysym.mod & KMOD_GUI)
|
||||
{
|
||||
break;
|
||||
}
|
||||
engine->onKeyRelease(event.key.keysym.sym, event.key.keysym.scancode, event.key.repeat, event.key.keysym.mod&KMOD_SHIFT, event.key.keysym.mod&KMOD_CTRL, event.key.keysym.mod&KMOD_ALT);
|
||||
break;
|
||||
case SDL_TEXTINPUT:
|
||||
|
@@ -402,12 +402,20 @@ void EventProcess(SDL_Event event)
|
||||
engine->Exit();
|
||||
break;
|
||||
case SDL_KEYDOWN:
|
||||
if (event.key.keysym.mod & KMOD_GUI)
|
||||
{
|
||||
break;
|
||||
}
|
||||
if (!event.key.repeat && event.key.keysym.sym == 'q' && (event.key.keysym.mod&KMOD_CTRL))
|
||||
engine->ConfirmExit();
|
||||
else
|
||||
engine->onKeyPress(event.key.keysym.sym, event.key.keysym.scancode, event.key.repeat, event.key.keysym.mod&KMOD_SHIFT, event.key.keysym.mod&KMOD_CTRL, event.key.keysym.mod&KMOD_ALT);
|
||||
break;
|
||||
case SDL_KEYUP:
|
||||
if (event.key.keysym.mod & KMOD_GUI)
|
||||
{
|
||||
break;
|
||||
}
|
||||
engine->onKeyRelease(event.key.keysym.sym, event.key.keysym.scancode, event.key.repeat, event.key.keysym.mod&KMOD_SHIFT, event.key.keysym.mod&KMOD_CTRL, event.key.keysym.mod&KMOD_ALT);
|
||||
break;
|
||||
case SDL_TEXTINPUT:
|
||||
|
Reference in New Issue
Block a user