Skip to content

Commit 1a42ce7

Browse files
committed
Add input characters utf8
1 parent 9435873 commit 1a42ce7

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

imgui/api/imgui.script_api

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,6 +1350,15 @@
13501350
- name: character
13511351
type: string
13521352

1353+
#*****************************************************************************************************
1354+
1355+
- name: add_input_characters
1356+
type: function
1357+
1358+
parameters:
1359+
- name: characters
1360+
type: string
1361+
13531362
#*****************************************************************************************************
13541363

13551364
- name: is_mouse_double_clicked

imgui/src/extension_imgui.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,14 @@ static int imgui_AddInputCharacter(lua_State* L)
475475
io.AddInputCharacter(c);
476476
return 0;
477477
}
478+
static int imgui_AddInputCharacters(lua_State* L)
479+
{
480+
DM_LUA_STACK_CHECK(L, 0);
481+
ImGuiIO& io = ImGui::GetIO();
482+
const char* s = luaL_checkstring(L, 1);
483+
io.AddInputCharactersUTF8(s);
484+
return 0;
485+
}
478486

479487

480488
// ----------------------------

0 commit comments

Comments
 (0)