-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't type Korean in the text box. #7979
Comments
I would be interested in your precise feedback, I wonder if this has something to do with #3653. |
ImGuiKoreanTest.mp4
In WinUser.h, defined as follows: So I think of CreateWindowW as creating a win32 window.
=============Below is my WinMain code. `// Main code if (!CreateDeviceD3D(hwnd)) ::ShowWindow(hwnd, SW_HIDE); // ImGuiManager 싱글턴 인스턴스 초기화 bool done = false;
} ImGuiManager::GetInstance()->Release(); return 0; |
(1) Can you compile example_win32_directx11 and test on it? (2) Does this makes any difference? |
Initially, example_win32_directx11 was also unable to type Korean. But in my project, I still can't type Korean.
|
Except for a few settings, my project is almost identical to example_win32_directx11. Here are a few other differences:
So, I tested it by removing the differences one by one. When I set io.ConfigViewportsNoAutoMerge to true in the ImGui configuration context, Korean input stops working. Please refer to the video below. ImGuiKoreanInputTest.mp4 |
This will make every imgui window use a platform (Windows) window created by the backend. Presumably, even with the flag disabled, if you move a window out of the main viewport boundary, then you should have the same problem? Either way it means looking at the _CreateWindow impl + the associated WndProc handler in second half of imgui_impl_win32 and trying to understand what is wrong and how it would differs how the main window was created. |
Yes, even with the flag disabled, the same problem occurs when I move the window outside the main viewport boundary. |
I believe the problem is that the vcpkg version may not compiled not for Unicode but for multi-byte mode and our code in vd->Hwnd = ::CreateWindowEx(
vd->DwExStyle, _T("ImGui Platform"), _T("Untitled"), vd->DwStyle, // Style, class name, window name
rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, // Window area
vd->HwndParent, nullptr, ::GetModuleHandle(nullptr), nullptr); // Owner window, Menu, Instance, Param I have pushed a tentative fix: 3293ef8 Because you are using backend precompiled by vcpkg I believe you cannot test this now and need to wait for a vcpkg update? |
Version/Branch of Dear ImGui:
Version 1.91.0, Branch: docking
Back-ends:
imgui_impl_win32.cpp + imgui_impl_dx11.cpp
Compiler, OS:
Windows 11 + MSVC 2022 + VS 2022 Preview
Full config/build information:
Details:
My Issue/Question:
I added a Korean font (malgun.ttf) that comes with Windows to use Korean in ImGui.
The result is
I have searched a lot in the last two days to solve this problem, and tried various things,
but I couldn't solve the problem.
What I've tried
Screenshots/Video:
ImGui.mp4
Minimal, Complete and Verifiable Example code:
My code is still in its early stages, and I've changed very little from the examples provided by ImGui.
//////////////////////////////////////////////////////////////////////////////
ImGuiManager.cpp
//////////////////////////////////////////////////////////////////////////////
#include "ImGuiManager.h"
void ImGuiManager::Init()
{
// ImGui Init
IMGUI_CHECKVERSION();
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO();
}
void ImGuiManager::SetupImGuiContext(HWND hwnd, ID3D11Device* device, ID3D11DeviceContext* deviceContext)
{
// Initialize the platform/renderer backend
ImGui_ImplWin32_Init(hwnd);
ImGui_ImplDX11_Init(device, deviceContext);
}
bool ImGuiManager::IsDone() const
{
return !isWindowOpen;
}
void ImGuiManager::Release()
{
// ImGui Shutdonw and Release Resources
ImGui_ImplDX11_Shutdown();
ImGui_ImplWin32_Shutdown();
ImGui::DestroyContext();
}
void ImGuiManager::Update()
{
// Start a new frame
ImGui_ImplDX11_NewFrame();
ImGui_ImplWin32_NewFrame();
ImGui::NewFrame();
}
void ImGuiManager::LateUpdate()
{
// Use when additional updates are required
}
void ImGuiManager::Render()
{
// ImGui Rendering Handling
ImGui::Render();
ImGui_ImplDX11_RenderDrawData(ImGui::GetDrawData());
}
void ImGuiManager::ResizeScreen()
{
// Handle actions required by screen size changes
}
void ImGuiManager::SetupStyle()
{
// Setting up styles
ImGui::StyleColorsDark();
ImGuiIO& io = ImGui::GetIO();
ImGuiStyle& style = ImGui::GetStyle();
}
//////////////////////////////////////////////////////////////////////////////
ImGuiManager.h
//////////////////////////////////////////////////////////////////////////////
#pragma once
#include <imgui.h>
#include <imgui_impl_win32.h>
#include <imgui_impl_dx11.h>
#include <d3d11.h>
#include "Types.h"
class ImGuiManager : public Singleton ,public Scene
{
public:
void Init() override;
void Release() override;
void Update() override;
void LateUpdate() override;
void Render() override;
void ResizeScreen() override;
public:
// Additional ImGui initialization functions (can be called directly)
void SetupImGuiContext(HWND hwnd, ID3D11Device* device, ID3D11DeviceContext* deviceContext);
private:
bool isWindowOpen{ true };
public:
bool IsDone() const;
private:
void SetupStyle();
};
struct Searcher
{
ImGuiTextBuffer Buf;
ImGuiTextFilter Filter;
ImVector LineOffsets; // Index to lines offset. We maintain this with AddLog() calls.
bool AutoScroll; // Keep scrolling if already at the bottom.
};
The text was updated successfully, but these errors were encountered: