From 43177324c081868116a99f634e2d5bf38b54056b Mon Sep 17 00:00:00 2001 From: ocornut Date: Tue, 1 Feb 2022 15:27:10 +0100 Subject: [PATCH] Backends: GLFW: Fixed miss untranslation of keypad keys. (#4921, #452) --- backends/imgui_impl_glfw.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backends/imgui_impl_glfw.cpp b/backends/imgui_impl_glfw.cpp index 7afb3169a..3fd2819d7 100644 --- a/backends/imgui_impl_glfw.cpp +++ b/backends/imgui_impl_glfw.cpp @@ -282,6 +282,8 @@ static int ImGui_ImplGlfw_TranslateUntranslatedKey(int key, int scancode) // See https://github.com/glfw/glfw/issues/1502 for details. // Adding a workaround to undo this (so our keys are translated->untranslated->translated, likely a lossy process). // This won't cover edge cases but this is at least going to cover common cases. + if (key >= GLFW_KEY_KP_0 && key <= GLFW_KEY_KP_EQUAL) + return key; const char* key_name = glfwGetKeyName(key, scancode); if (key_name && key_name[0] != 0 && key_name[1] == 0) {