From ea989fce76cf0eec59a7104a5c521809ed2657a5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 28 Jul 2017 02:02:27 +0300 Subject: Fix key press emulation with SDL2. --- src/gui/sdlinput.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gui/sdlinput.cpp b/src/gui/sdlinput.cpp index 1a26bdfb3..3fd122002 100644 --- a/src/gui/sdlinput.cpp +++ b/src/gui/sdlinput.cpp @@ -392,13 +392,14 @@ void SDLInput::simulateKey(const int guiKey, keyInput.setKey(Key(KeyValue::TEXTINPUT)); keyInput.setText(str); -#else // USE_SDL2 - - keyInput.setKey(Key(guiKey)); - + if (guiKey >= 32) + mKeyInputQueue.push(keyInput); #endif // USE_SDL2 + keyInput.setKey(Key(guiKey)); if (actionId > InputAction::NO_VALUE) keyInput.setActionId(actionId); mKeyInputQueue.push(keyInput); + keyInput.setType(KeyEventType::RELEASED); + mKeyInputQueue.push(keyInput); } -- cgit v1.2.3-60-g2f50