From 85163b531f283c52111c3964fd382e4ed1dafeb8 Mon Sep 17 00:00:00 2001 From: yw05 <37980625+yw05@users.noreply.github.com> Date: Mon, 5 Apr 2021 15:56:29 +0200 Subject: Make edit boxes respond to string input (IME) (#11156) Make edit boxes respond to string input events (introduced in minetest/irrlicht#23) that are usually triggered by entering text with an IME. --- src/gui/guiChatConsole.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/gui/guiChatConsole.cpp') diff --git a/src/gui/guiChatConsole.cpp b/src/gui/guiChatConsole.cpp index b7af0ca0f..baaaea5e8 100644 --- a/src/gui/guiChatConsole.cpp +++ b/src/gui/guiChatConsole.cpp @@ -17,6 +17,7 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include "IrrCompileConfig.h" #include "guiChatConsole.h" #include "chat.h" #include "client/client.h" @@ -618,6 +619,13 @@ bool GUIChatConsole::OnEvent(const SEvent& event) m_chat_backend->scroll(rows); } } +#if (IRRLICHT_VERSION_MT_REVISION >= 2) + else if(event.EventType == EET_STRING_INPUT_EVENT) + { + prompt.input(std::wstring(event.StringInput.Str->c_str())); + return true; + } +#endif return Parent ? Parent->OnEvent(event) : false; } -- cgit v1.2.3