summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-07-28 02:02:27 +0300
committerAndrei Karas <akaras@inbox.ru>2017-07-28 02:02:27 +0300
commitea989fce76cf0eec59a7104a5c521809ed2657a5 (patch)
treee14ed594e40ea9888e5575ffe8f6a2b4ef271e08
parent3217105fd8f32b20f226701339cbfb2fa950518c (diff)
downloadplus-ea989fce76cf0eec59a7104a5c521809ed2657a5.tar.gz
plus-ea989fce76cf0eec59a7104a5c521809ed2657a5.tar.bz2
plus-ea989fce76cf0eec59a7104a5c521809ed2657a5.tar.xz
plus-ea989fce76cf0eec59a7104a5c521809ed2657a5.zip
Fix key press emulation with SDL2.
-rw-r--r--src/gui/sdlinput.cpp9
1 files 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);
}