Skip to content

Commit

Permalink
Backends: GLFW: fix ImGui_ImplGlfw_TranslateUntranslatedKey() for gra…
Browse files Browse the repository at this point in the history
…ve accents. (#456, #2625)

Amend 100ede5
  • Loading branch information
ocornut committed Jan 24, 2022
1 parent b17b2fb commit 15c8e56
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backends/imgui_impl_glfw.cpp
Expand Up @@ -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'); }
Expand Down

0 comments on commit 15c8e56

Please sign in to comment.