mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-11 00:04:24 +00:00
Add support for WM_IME_CHAR in Win32 backend
Handle WM_IME_CHAR message for input character processing.
This commit is contained in:
parent
75b6b612ed
commit
48e655706d
1 changed files with 15 additions and 0 deletions
|
|
@ -879,6 +879,21 @@ IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandlerEx(HWND hwnd, UINT msg, WPA
|
|||
case WM_INPUTLANGCHANGE:
|
||||
ImGui_ImplWin32_UpdateKeyboardCodePage(io);
|
||||
return 0;
|
||||
case WM_IME_CHAR :
|
||||
if (::IsWindowUnicode(hwnd) == FALSE)
|
||||
{
|
||||
unsigned short ch = (unsigned short)wParam;
|
||||
if (::IsDBCSLeadByte(HIBYTE(wParam)))
|
||||
{
|
||||
ch = MAKEWORD(HIBYTE(wParam), LOBYTE(wParam));
|
||||
}
|
||||
|
||||
wchar_t wch = 0;
|
||||
::MultiByteToWideChar(bd->KeyboardCodePage, MB_PRECOMPOSED, (char*)&ch, sizeof(ch), &wch, 1);
|
||||
io.AddInputCharacterUTF16(wch);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
case WM_CHAR:
|
||||
if (::IsWindowUnicode(hwnd))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue