diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-05-24 17:41:52 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-05-24 17:41:52 +0300 |
commit | c3699037bc32dd43ae1b5501261808eb3425697c (patch) | |
tree | 47687e5bd758b76a35d91feb4820f5ecf6653984 /src/gui/sdlinput.cpp | |
parent | 0ae255cde4e75bfad569a0e546b6ef86b921b881 (diff) | |
download | manaverse-c3699037bc32dd43ae1b5501261808eb3425697c.tar.gz manaverse-c3699037bc32dd43ae1b5501261808eb3425697c.tar.bz2 manaverse-c3699037bc32dd43ae1b5501261808eb3425697c.tar.xz manaverse-c3699037bc32dd43ae1b5501261808eb3425697c.zip |
Fix chat command with SDL2 for send string to input.
Diffstat (limited to 'src/gui/sdlinput.cpp')
-rw-r--r-- | src/gui/sdlinput.cpp | 12 |
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); |