From b7d1b91e4bc2c73792e111c2c269e6f82d21a8e3 Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Thu, 16 Jul 2015 05:16:22 +0200 Subject: [PATCH] Use ImGuiIO::AddInputCharactersUTF8() in SDL2 example Now Unicode text input works in this example. --- examples/sdl_opengl_example/imgui_impl_sdl.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/examples/sdl_opengl_example/imgui_impl_sdl.cpp b/examples/sdl_opengl_example/imgui_impl_sdl.cpp index 10260d2d..980b11dc 100644 --- a/examples/sdl_opengl_example/imgui_impl_sdl.cpp +++ b/examples/sdl_opengl_example/imgui_impl_sdl.cpp @@ -118,9 +118,7 @@ bool ImGui_ImplSdl_ProcessEvent(SDL_Event* event) case SDL_TEXTINPUT: { ImGuiIO& io = ImGui::GetIO(); - unsigned int c = event->text.text[0]; - if (c > 0 && c < 0x10000) - io.AddInputCharacter((unsigned short)c); + io.AddInputCharactersUTF8(event->text.text); return true; } case SDL_KEYDOWN: