From 481ea0b776bbab92b500540f59c5a191c6e93cba Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 9 Sep 2017 22:54:01 +0300 Subject: Add workaround for fix alt-tab issue in SDL2. Also add option to enable/disable this workaround. --- src/input/inputmanager.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/input/inputmanager.cpp') diff --git a/src/input/inputmanager.cpp b/src/input/inputmanager.cpp index dbe82d5da..42a4e3b25 100644 --- a/src/input/inputmanager.cpp +++ b/src/input/inputmanager.cpp @@ -594,6 +594,14 @@ bool InputManager::handleEvent(const SDL_Event &restrict event) restrict2 { case SDL_KEYDOWN: { +#ifdef USE_SDL2 + if (keyboard.ignoreKey(event)) + { + BLOCK_END("InputManager::handleEvent") + return true; + } +#endif // USE_SDL2 + keyboard.refreshActiveKeys(); updateConditionMask(); if (handleAssignKey(event, InputType::KEYBOARD)) @@ -620,6 +628,14 @@ bool InputManager::handleEvent(const SDL_Event &restrict event) restrict2 } case SDL_KEYUP: { +#ifdef USE_SDL2 + if (keyboard.ignoreKey(event)) + { + BLOCK_END("InputManager::handleEvent") + return true; + } +#endif // USE_SDL2 + keyboard.refreshActiveKeys(); updateConditionMask(); keyboard.handleDeActicateKey(event); -- cgit v1.2.3-60-g2f50