mirror of
https://github.com/Drezil/imgui.git
synced 2024-12-18 14:16:36 +00:00
Use ImGuiIO::AddInputCharactersUTF8() in SDL2 example
Now Unicode text input works in this example.
This commit is contained in:
parent
be8fb858cc
commit
b7d1b91e4b
@ -118,9 +118,7 @@ bool ImGui_ImplSdl_ProcessEvent(SDL_Event* event)
|
|||||||
case SDL_TEXTINPUT:
|
case SDL_TEXTINPUT:
|
||||||
{
|
{
|
||||||
ImGuiIO& io = ImGui::GetIO();
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
unsigned int c = event->text.text[0];
|
io.AddInputCharactersUTF8(event->text.text);
|
||||||
if (c > 0 && c < 0x10000)
|
|
||||||
io.AddInputCharacter((unsigned short)c);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
case SDL_KEYDOWN:
|
case SDL_KEYDOWN:
|
||||||
|
Loading…
Reference in New Issue
Block a user