From 1a42ce787e408468e60ebd552292dc30a4c13e48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ritzl?= Date: Mon, 8 Jul 2024 00:14:33 +0200 Subject: [PATCH] Add input characters utf8 --- imgui/api/imgui.script_api | 9 +++++++++ imgui/src/extension_imgui.cpp | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/imgui/api/imgui.script_api b/imgui/api/imgui.script_api index 6931a30..61167e4 100644 --- a/imgui/api/imgui.script_api +++ b/imgui/api/imgui.script_api @@ -1350,6 +1350,15 @@ - name: character type: string +#***************************************************************************************************** + + - name: add_input_characters + type: function + + parameters: + - name: characters + type: string + #***************************************************************************************************** - name: is_mouse_double_clicked diff --git a/imgui/src/extension_imgui.cpp b/imgui/src/extension_imgui.cpp index eecd886..4a0fd32 100644 --- a/imgui/src/extension_imgui.cpp +++ b/imgui/src/extension_imgui.cpp @@ -475,6 +475,14 @@ static int imgui_AddInputCharacter(lua_State* L) io.AddInputCharacter(c); return 0; } +static int imgui_AddInputCharacters(lua_State* L) +{ + DM_LUA_STACK_CHECK(L, 0); + ImGuiIO& io = ImGui::GetIO(); + const char* s = luaL_checkstring(L, 1); + io.AddInputCharactersUTF8(s); + return 0; +} // ----------------------------