Skip to content

IME input problem. #4642

@urjskhzk

Description

@urjskhzk

Version/Branch of Dear ImGui:

Version: 1.84.2
Branch: master

Back-end/Renderer/Compiler/OS

Back-ends: win32 dx9
Compiler: vs2019
Operating System: Windows 10

My Issue/Question:

This is a case when WM_CHAR and WM_LBUTTONDOWN events occur at the same time.

io.MouseDown[0]: true
io.InputQueueCharacters: Size 1, Data 44032 '가'

  1. Good
static bool b = false;
static char buf[256] = { 0, };
ImGui::Begin("Hello, world!");
ImGui::InputText("InputText", buf, _countof(buf));
ImGui::Checkbox("Checkbox", &b);
ImGui::End();

1

  1. Bad
static bool b = false;
static char buf[256] = { 0, };
ImGui::Begin("Hello, world!");
ImGui::Checkbox("Checkbox", &b);
ImGui::InputText("InputText", buf, _countof(buf));
ImGui::End();

2

  1. A is Good / B is Bad
static char buf1[36] = { 0, };
static char buf2[36] = { 0, };
ImGui::Begin("Hello, world!");
ImGui::InputText("A", buf1, _countof(buf1));
ImGui::InputText("B", buf2, _countof(buf2));
ImGui::End();

3

Screenshots/Video

Standalone, minimal, complete and verifiable example:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions