-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[win32] Standard shortcuts stop working in input widgets #2976
Comments
Thank you for the report. This is the first time I use Win+V I didn't even know this feature existed. So it looks like there are multiple issues at end: (1) Investigate why SDL and GLFW don't correctly report when the In this screenshot the Win+V ui is open, and the Windows key has been released already and it's still reported as pressed: (note that text appearing in the OS UI on the top-right is just my clipboard history!). This is essentially similar to #2062 in essence. (2) Investigate if we could expose the My intuition is the following:
In fact that later option we should apply right now, since that's the immediate best fix we have, while we investigate SDL/GLFW further. |
Reason for this happening is that io.KeysDown[VK_LWIN] &= (::GetKeyState(VK_LWIN) & 0x8000) != 0;
io.KeysDown[VK_RWIN] &= (::GetKeyState(VK_RWIN) & 0x8000) != 0;
io.KeySuper = io.KeysDown[VK_LWIN] || io.KeysDown[VK_RWIN]; This clears keys in stuck state manually. Bonus: it also implements Problem is actually deeper than this. Turns out any key will get stuck in a pressed key state because win32 does not send Reported bugs: |
… cases. Fixes ocornut#2976. Issue can be observed if we press WinKey+v when win32/SDL/GLFW window is focused. Application would get stuck in a state thinking WinKey is pressed even after it was released.
… cases. Fixes ocornut#2976. Issue can be observed if we press WinKey+v when win32/SDL/GLFW window is focused. Application would get stuck in a state thinking WinKey is pressed even after it was released.
This will be fixed in next GLFW release. |
Closing this as a non-dear imgui issue, reported to GLFW and SDL and fixed in GLFW. Thanks Stanislav and Rokups. |
…sed. 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)
Version/Branch of Dear ImGui:
Version:
1.75 WIP (17401)
Branch: master and docking
Back-end/Renderer/Compiler/OS
Back-ends: imgui_impl_sdl.cpp and imgui_impl_glfw.cpp
Operating System: Windows 10 1909
My Issue/Question:
Standard ctrl based hotkeys for input widgets stop working after using some windows/keysuper system shortcuts like win+space (change input language) and win+v (clipboard history, appeared in Windows 10 1809). It stops working until window reactivation.
Problem is here:
imgui/examples/imgui_impl_glfw.cpp
Line 124 in f03c00b
imgui/examples/imgui_impl_sdl.cpp
Line 118 in f03c00b
And when we pressed: win-space, then ctrl-z. we got is_shortcut_key == false, because io.KeySuper ==1 and io.KeyCtrl also equals to 1.
imgui/imgui_widgets.cpp
Line 3671 in f03c00b
I don't know why KeySuper state not clears after KEYUP event. As workaround i use
#ifndef _WIN32
guardIn pure win32 backend io.KeySuper always sets to false.
imgui/examples/imgui_impl_win32.cpp
Line 223 in f03c00b
Standalone, minimal, complete and verifiable example:
Just open Demo window in default sdl/glfw examples and go to Multi-line text widget example.
The text was updated successfully, but these errors were encountered: