diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-07-28 02:02:27 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-07-28 02:02:27 +0300 |
commit | ea989fce76cf0eec59a7104a5c521809ed2657a5 (patch) | |
tree | e14ed594e40ea9888e5575ffe8f6a2b4ef271e08 /src/gui/sdlinput.cpp | |
parent | 3217105fd8f32b20f226701339cbfb2fa950518c (diff) | |
download | manaverse-ea989fce76cf0eec59a7104a5c521809ed2657a5.tar.gz manaverse-ea989fce76cf0eec59a7104a5c521809ed2657a5.tar.bz2 manaverse-ea989fce76cf0eec59a7104a5c521809ed2657a5.tar.xz manaverse-ea989fce76cf0eec59a7104a5c521809ed2657a5.zip |
Fix key press emulation with SDL2.
Diffstat (limited to 'src/gui/sdlinput.cpp')
-rw-r--r-- | src/gui/sdlinput.cpp | 9 |
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); } |