-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
OSX: KeyCtrl doesn't release when released in another app (e.g. when using Cmd+Tab) #3832
Comments
imgui_impl_opengl3.h
+ imgui_impl_osx.h
I don't know what Cmd+Tab is mapped to. It is switching to other OS window (OSX ui) or other Dear ImGui window? (dear imgui "ctrl+tab" window). Given your ConfigFlags I am assuming keyboard nav is disabled so it is the earlier, but it is bizarre you suggest using I believe this is the same as #3532 but specifically for the OSX backend. |
@ocornut Good question, should have been more specific. It's switching to a different OS window (through the OSX ui). I also tested more and you're correct, using
Yes, looks like the same thing, but with the OSX backend and with the command key. In the other thread you suggest "arbitrary clearly all inputs while unfocused is a typical workaround people use on this sort of case, but is not a generally correct/valid solution" - are you basically suggesting to set |
I was referring to back-end clearing all Keys[] and key modifiers when all dear imgui windows are unfocused. |
What if you alt-tab to another window, keep holding alt and then alt-tab back? No new "key-down" event would fire, alt would remain held down but down state would be cleared as window regained focus. |
That's technically a bug but pragmatically this is less problematic and a MUCH better default than currently and many apps behave this way. I'll now be applying this clearing in the Win32 backend and would appreciate the equivalent PR for native OSX backend. |
…bing to a different application. (ocornut#3832)
…bing to a different application. (#3832)
Full info
Version/Branch of Dear ImGui:
Version: 1.80 WIP - commit
388ca563dbb0fa683d2a8fbf1daaf2ab77f98a21
Branch: docking
Back-end/Renderer/Compiler/OS
Back-ends:
imgui_impl_opengl3.h
+imgui_impl_osx.h
Compiler:
clang-1200.0.32.28
Operating System:
OS X
My Issue/Question:
When on a mac, you can use "Cmd + Tab" to quickly jump to another window. When you do that and then come back,
ImGui::GetIO().KeyCtrl
will be true even if you're not pressing down theCmd
key.Standalone, minimal, complete and verifiable example: (see #2261)
Run the following code. Then use "Cmd + Tab" to go to another window, then come back. You'll see that
KeyShift: true
.Workaround:
You can manually reset it with:
The text was updated successfully, but these errors were encountered: