From c3699037bc32dd43ae1b5501261808eb3425697c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 24 May 2017 17:41:52 +0300 Subject: Fix chat command with SDL2 for send string to input. --- src/gui/sdlinput.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/gui/sdlinput.cpp') 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); -- cgit v1.2.3-60-g2f50