-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Stuck Key Input Issue and Misdetected keys #2062
Comments
You are right. We don't receive the Happy to hear feedback of how people handle this sorts of thing their own engine? In dear imgui world this becomes a little more involved in the Viewport branch as there are multiple Win32 windows at play. I'll look at it eventually (suggestion/fixes that are compatible with the Viewport branch are welcome). |
Update:
I've refined the code but forgot to publish. Adding this to WndProcHandler will solve the issue. Additional way:
if you include you can use it like this very simple and short. |
Thanks for the easy fix! I was running into the same issue when I was hitting a breakpoint inside my code that responded to InputText returning true, so the debugger stole input and the WM_KEYUP got lost. |
#3961 suggested using:
I however mentioned that the problem is that none of those strategy works for multi-viewports, but I'll look for a solution that is multi-viewports compatible. |
I pushed the WM_KILLFOCUS suggested fix now : 1491d2c As it happens, in docking + multi-viewports enabled it does make held key flick off for one frame, but this issue has also been present in the GLFW backend and no-one noticed that before, so my conclusion is that it's a much less problematic issue than the one we are fixing now. We can improve on the multi-viewports code later. |
Could/should the same fix be implemented in the backend for |
Latest version of ImGui and every renderer in win32
Lately I made a custom widget which is a hotkey container for assigning keys to jobs. My issue is if you change the active window while you holding a key, key becomes stuck in pressed state and only pressing again that key solves that problem. To demonstrate it, just open the ImGui xxxx example doesn't matter the renderer just win32, and go to the inputs section and keyboard mouse states. After that just try to alt tab (easy demo) or activate another window while you holding a key. You will see that key is flashing like pressing rapidly in "key pressed:" section. That causes to not detecting the proper keystroke.
The text was updated successfully, but these errors were encountered: