diff --git a/src/Nazara/Platform/SDL2/WindowImpl.cpp b/src/Nazara/Platform/SDL2/WindowImpl.cpp index e2a71f27b..f17ce3c3c 100644 --- a/src/Nazara/Platform/SDL2/WindowImpl.cpp +++ b/src/Nazara/Platform/SDL2/WindowImpl.cpp @@ -2,8 +2,6 @@ // This file is part of the "Nazara Engine - Platform module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include -#include #include #include #include @@ -19,6 +17,9 @@ #include #include #include +#include +#include +#include namespace Nz { @@ -488,23 +489,26 @@ namespace Nz break; case SDL_TEXTINPUT: + { if (SDL_GetWindowID(window->m_handle) != event->text.windowID) return 0; evt.type = WindowEventType_TextEntered; evt.text.repeated = false; - for (decltype(evt.text.character) codepoint : String::Unicode(event->text.text).Simplify().GetUtf32String()) + utf8::unchecked::iterator it(event->text.text); + do { - evt.text.character = codepoint; + evt.text.character = *it; window->m_parent->PushEvent(evt); - } + } while (*it++); // prevent post switch event evt.type = WindowEventType::WindowEventType_Max; break; + } case SDL_TEXTEDITING: if (SDL_GetWindowID(window->m_handle) != event->edit.windowID)