From 4caf1e9b597a3a9f2e919c2e4c6576f638d5a00d Mon Sep 17 00:00:00 2001 From: ocornut Date: Mon, 24 Jan 2022 13:45:47 +0100 Subject: [PATCH] Backends: GLFW: fix ImGui_ImplGlfw_TranslateUntranslatedKey() for grave accents. (#456, #2625) + fix preceeding commit. Amend 100ede57 + amend b17b2fb --- backends/imgui_impl_glfw.cpp | 2 +- imgui.cpp | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/backends/imgui_impl_glfw.cpp b/backends/imgui_impl_glfw.cpp index 17c210ac1..b5b118386 100644 --- a/backends/imgui_impl_glfw.cpp +++ b/backends/imgui_impl_glfw.cpp @@ -286,7 +286,7 @@ static int ImGui_ImplGlfw_TranslateUntranslatedKey(int key, int scancode) const char* key_name = glfwGetKeyName(key, scancode); if (key_name && key_name[0] != 0 && key_name[1] == 0) { - const char char_names[] = "'-=[]\\,;\'./"; + const char char_names[] = "`-=[]\\,;\'./"; const int char_keys[] = { GLFW_KEY_GRAVE_ACCENT, GLFW_KEY_MINUS, GLFW_KEY_EQUAL, GLFW_KEY_LEFT_BRACKET, GLFW_KEY_RIGHT_BRACKET, GLFW_KEY_BACKSLASH, GLFW_KEY_COMMA, GLFW_KEY_SEMICOLON, GLFW_KEY_APOSTROPHE, GLFW_KEY_PERIOD, GLFW_KEY_SLASH, 0 }; IM_ASSERT(IM_ARRAYSIZE(char_names) == IM_ARRAYSIZE(char_keys)); if (key_name[0] >= '0' && key_name[0] <= '9') { key = GLFW_KEY_0 + (key_name[0] - '0'); } diff --git a/imgui.cpp b/imgui.cpp index bf2452d87..c6104dc5e 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -6099,7 +6099,6 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) // UPDATE CONTENTS SIZE, UPDATE HIDDEN STATUS // Update contents size from last frame for auto-fitting (or use explicit size) - const bool window_just_appearing_after_hidden_for_resize = (window->HiddenFramesCannotSkipItems > 0); CalcWindowContentSizes(window, &window->ContentSize, &window->ContentSizeIdeal); if (window->HiddenFramesCanSkipItems > 0) window->HiddenFramesCanSkipItems--;