mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-22 20:07:01 +00:00
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:
parent
e499497ec5
commit
8bcac7d95c
@ -84,12 +84,14 @@ Other Changes:
|
|||||||
- Backends: GLFW: Added support for the missing mouse cursors newly added in GLFW 3.4+. [@rokups]
|
- Backends: GLFW: Added support for the missing mouse cursors newly added in GLFW 3.4+. [@rokups]
|
||||||
- Backends: SDL: Wayland: use SDL_GetMouseState (because there is no global mouse state available
|
- Backends: SDL: Wayland: use SDL_GetMouseState (because there is no global mouse state available
|
||||||
on Wayland). (#2800, #2802) [@NeroBurner]
|
on Wayland). (#2800, #2802) [@NeroBurner]
|
||||||
|
- 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)
|
||||||
- Backends: Win32: Added support for #define IMGUI_IMPL_WIN32_DISABLE_GAMEPAD to disable all
|
- Backends: Win32: Added support for #define IMGUI_IMPL_WIN32_DISABLE_GAMEPAD to disable all
|
||||||
XInput using code, and IMGUI_IMPL_WIN32_DISABLE_LINKING_XINPUT to disable linking with XInput,
|
XInput using code, and IMGUI_IMPL_WIN32_DISABLE_LINKING_XINPUT to disable linking with XInput,
|
||||||
the later may be problematic if compiling with recent Windows SDK and you want your app to run
|
the later may be problematic if compiling with recent Windows SDK and you want your app to run
|
||||||
on Windows 7. You can instead try linking with Xinput9_1_0.lib instead. (#2716)
|
on Windows 7. You can instead try linking with Xinput9_1_0.lib instead. (#2716)
|
||||||
- Backends: Win32: Added support for io.KeySuper (Windows key) for consistency with other backends,
|
|
||||||
even if realistically it is difficult to make good use of under Windows.
|
|
||||||
- CI: Added PVS-Studio static analysis on the continuous-integration server. [@rokups]
|
- CI: Added PVS-Studio static analysis on the continuous-integration server. [@rokups]
|
||||||
- Examples: Explicitly adding -DIMGUI_IMPL_OPENGL_LOADER_GL3W to Makefile to match linking
|
- Examples: Explicitly adding -DIMGUI_IMPL_OPENGL_LOADER_GL3W to Makefile to match linking
|
||||||
settings (otherwise if another loader such as Glew is accessible, the OpenGL3 backend might
|
settings (otherwise if another loader such as Glew is accessible, the OpenGL3 backend might
|
||||||
|
@ -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.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.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];
|
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];
|
io.KeySuper = io.KeysDown[GLFW_KEY_LEFT_SUPER] || io.KeysDown[GLFW_KEY_RIGHT_SUPER];
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImGui_ImplGlfw_CharCallback(GLFWwindow* window, unsigned int c)
|
void ImGui_ImplGlfw_CharCallback(GLFWwindow* window, unsigned int c)
|
||||||
|
@ -115,7 +115,11 @@ bool ImGui_ImplSDL2_ProcessEvent(const SDL_Event* event)
|
|||||||
io.KeyShift = ((SDL_GetModState() & KMOD_SHIFT) != 0);
|
io.KeyShift = ((SDL_GetModState() & KMOD_SHIFT) != 0);
|
||||||
io.KeyCtrl = ((SDL_GetModState() & KMOD_CTRL) != 0);
|
io.KeyCtrl = ((SDL_GetModState() & KMOD_CTRL) != 0);
|
||||||
io.KeyAlt = ((SDL_GetModState() & KMOD_ALT) != 0);
|
io.KeyAlt = ((SDL_GetModState() & KMOD_ALT) != 0);
|
||||||
|
#ifdef _WIN32
|
||||||
|
io.KeySuper = false;
|
||||||
|
#else
|
||||||
io.KeySuper = ((SDL_GetModState() & KMOD_GUI) != 0);
|
io.KeySuper = ((SDL_GetModState() & KMOD_GUI) != 0);
|
||||||
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,6 @@
|
|||||||
|
|
||||||
// CHANGELOG
|
// CHANGELOG
|
||||||
// (minor and older changes stripped away, please see git history for details)
|
// (minor and older changes stripped away, please see git history for details)
|
||||||
// 2020-01-17: Inputs: Added support for io.KeySuper (Windows key) for consistency with other backends, even if realistically it is difficult to make good use of under Windows.
|
|
||||||
// 2020-01-14: Inputs: Added support for #define IMGUI_IMPL_WIN32_DISABLE_GAMEPAD/IMGUI_IMPL_WIN32_DISABLE_LINKING_XINPUT.
|
// 2020-01-14: Inputs: Added support for #define IMGUI_IMPL_WIN32_DISABLE_GAMEPAD/IMGUI_IMPL_WIN32_DISABLE_LINKING_XINPUT.
|
||||||
// 2019-12-05: Inputs: Added support for ImGuiMouseCursor_NotAllowed mouse cursor.
|
// 2019-12-05: Inputs: Added support for ImGuiMouseCursor_NotAllowed mouse cursor.
|
||||||
// 2019-05-11: Inputs: Don't filter value from WM_CHAR before calling AddInputCharacter().
|
// 2019-05-11: Inputs: Don't filter value from WM_CHAR before calling AddInputCharacter().
|
||||||
@ -230,7 +229,7 @@ void ImGui_ImplWin32_NewFrame()
|
|||||||
io.KeyCtrl = (::GetKeyState(VK_CONTROL) & 0x8000) != 0;
|
io.KeyCtrl = (::GetKeyState(VK_CONTROL) & 0x8000) != 0;
|
||||||
io.KeyShift = (::GetKeyState(VK_SHIFT) & 0x8000) != 0;
|
io.KeyShift = (::GetKeyState(VK_SHIFT) & 0x8000) != 0;
|
||||||
io.KeyAlt = (::GetKeyState(VK_MENU) & 0x8000) != 0;
|
io.KeyAlt = (::GetKeyState(VK_MENU) & 0x8000) != 0;
|
||||||
io.KeySuper = ((::GetKeyState(VK_LWIN) | ::GetKeyState(VK_RWIN)) & 0x8000) != 0;
|
io.KeySuper = false;
|
||||||
// io.KeysDown[], io.MousePos, io.MouseDown[], io.MouseWheel: filled by the WndProc handler below.
|
// io.KeysDown[], io.MousePos, io.MouseDown[], io.MouseWheel: filled by the WndProc handler below.
|
||||||
|
|
||||||
// Update OS mouse position
|
// Update OS mouse position
|
||||||
|
Loading…
Reference in New Issue
Block a user