Skip to content

Commit

Permalink
Add input characters utf8
Browse files Browse the repository at this point in the history
  • Loading branch information
britzl committed Jul 7, 2024
1 parent 9435873 commit 1a42ce7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions imgui/api/imgui.script_api
Original file line number Diff line number Diff line change
Expand Up @@ -1350,6 +1350,15 @@
- name: character
type: string

#*****************************************************************************************************

- name: add_input_characters
type: function

parameters:
- name: characters
type: string

#*****************************************************************************************************

- name: is_mouse_double_clicked
Expand Down
8 changes: 8 additions & 0 deletions imgui/src/extension_imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}


// ----------------------------
Expand Down

0 comments on commit 1a42ce7

Please sign in to comment.