1
0
mirror of synced 2024-11-24 15:50:16 +01:00

fix: Invalid key code error spam

This commit is contained in:
WerWolv 2023-05-23 13:20:18 +02:00
parent 5bbf4342ee
commit cb9a3b1f55
4 changed files with 9 additions and 1 deletions

View File

@ -414,6 +414,10 @@ void ImGui_ImplGlfw_KeyCallback(GLFWwindow* window, int keycode, int scancode, i
if (bd->PrevUserCallbackKey != NULL && window == bd->Window)
bd->PrevUserCallbackKey(window, keycode, scancode, action, mods);
// IMHEX PATCH BEGIN
if (keycode == GLFW_KEY_UNKNOWN)
return;
// IMHEX PATCH END
if (action != GLFW_PRESS && action != GLFW_RELEASE)
return;

@ -1 +1 @@
Subproject commit 49f3fb30dcb3044a2bb535958b7b954c81ec23ef
Subproject commit 2b0c7a4a4c2325a5cd6dc6104b5a85bbde85ff37

View File

@ -30,6 +30,8 @@ enum ImGuiCustomCol {
ImGuiCustomCol_IEEEToolExp,
ImGuiCustomCol_IEEEToolMantissa,
ImGuiCustomCol_BlurBackground,
ImGuiCustomCol_COUNT
};

View File

@ -864,6 +864,8 @@ namespace hex {
glfwSetKeyCallback(this->m_window, [](GLFWwindow *window, int key, int scancode, int action, int mods) {
hex::unused(mods);
if (key == GLFW_KEY_UNKNOWN) return;
auto keyName = glfwGetKeyName(key, scancode);
if (keyName != nullptr)
key = std::toupper(keyName[0]);