summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-05-24 17:41:52 +0300
committerAndrei Karas <akaras@inbox.ru>2017-05-24 17:41:52 +0300
commitc3699037bc32dd43ae1b5501261808eb3425697c (patch)
tree47687e5bd758b76a35d91feb4820f5ecf6653984
parent0ae255cde4e75bfad569a0e546b6ef86b921b881 (diff)
downloadplus-c3699037bc32dd43ae1b5501261808eb3425697c.tar.gz
plus-c3699037bc32dd43ae1b5501261808eb3425697c.tar.bz2
plus-c3699037bc32dd43ae1b5501261808eb3425697c.tar.xz
plus-c3699037bc32dd43ae1b5501261808eb3425697c.zip
Fix chat command with SDL2 for send string to input.
-rw-r--r--src/gui/sdlinput.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gui/sdlinput.cpp b/src/gui/sdlinput.cpp
index 29b6534c1..86f2a1b37 100644
--- a/src/gui/sdlinput.cpp
+++ b/src/gui/sdlinput.cpp
@@ -365,7 +365,19 @@ void SDLInput::simulateKey(const int guiKey,
{
KeyInput keyInput;
keyInput.setType(KeyEventType::PRESSED);
+#ifdef USE_SDL2
+ char str[2];
+ str[0] = guiKey;
+ str[1] = 0;
+
+ keyInput.setKey(Key(KeyValue::TEXTINPUT));
+ keyInput.setText(str);
+#else // USE_SDL2
+
keyInput.setKey(Key(guiKey));
+
+#endif // USE_SDL2
+
if (actionId > InputAction::NO_VALUE)
keyInput.setActionId(actionId);
mKeyInputQueue.push(keyInput);