Merge branch 'master' into docking

# Conflicts:
#	backends/imgui_impl_dx10.cpp
#	backends/imgui_impl_dx11.cpp
#	backends/imgui_impl_dx12.cpp
#	backends/imgui_impl_dx9.cpp
#	backends/imgui_impl_glfw.cpp
#	backends/imgui_impl_opengl2.cpp
#	backends/imgui_impl_opengl3.cpp
#	imgui.cpp
This commit is contained in:
ocornut
2021-05-19 19:05:01 +02:00
23 changed files with 344 additions and 287 deletions

View File

@ -135,15 +135,18 @@ void ImGui_ImplGlfw_KeyCallback(GLFWwindow* window, int key, int scancode, int a
g_PrevUserCallbackKey(window, key, scancode, action, mods);
ImGuiIO& io = ImGui::GetIO();
if (action == GLFW_PRESS)
if (key >= 0 && key < IM_ARRAYSIZE(io.KeysDown))
{
io.KeysDown[key] = true;
g_KeyOwnerWindows[key] = window;
}
if (action == GLFW_RELEASE)
{
io.KeysDown[key] = false;
g_KeyOwnerWindows[key] = NULL;
if (action == GLFW_PRESS)
{
io.KeysDown[key] = true;
g_KeyOwnerWindows[key] = window;
}
if (action == GLFW_RELEASE)
{
io.KeysDown[key] = false;
g_KeyOwnerWindows[key] = NULL;
}
}
// Modifiers are not reliable across systems