Backends: GLFW, SDL: report Windows key (io.KeySuper) as always released.

Neither GLFW nor SDL can correctly report the key release in every cases (e.g. when using Win+V) causing problems with some widgets. The next release of GLFW (3.4+) will have a fix for it. However since it is both difficult and discouraged to make use of this key for Windows application anyway, we just hide it. (#2976)
This commit is contained in:
omar
2020-01-17 15:18:33 +01:00
parent e499497ec5
commit 8bcac7d95c
4 changed files with 13 additions and 4 deletions

View File

@ -122,7 +122,11 @@ void ImGui_ImplGlfw_KeyCallback(GLFWwindow* window, int key, int scancode, int a
io.KeyCtrl = io.KeysDown[GLFW_KEY_LEFT_CONTROL] || io.KeysDown[GLFW_KEY_RIGHT_CONTROL];
io.KeyShift = io.KeysDown[GLFW_KEY_LEFT_SHIFT] || io.KeysDown[GLFW_KEY_RIGHT_SHIFT];
io.KeyAlt = io.KeysDown[GLFW_KEY_LEFT_ALT] || io.KeysDown[GLFW_KEY_RIGHT_ALT];
#ifdef _WIN32
io.KeySuper = false;
#else
io.KeySuper = io.KeysDown[GLFW_KEY_LEFT_SUPER] || io.KeysDown[GLFW_KEY_RIGHT_SUPER];
#endif
}
void ImGui_ImplGlfw_CharCallback(GLFWwindow* window, unsigned int c)