-
-
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
SetNextFrameWantCaptureKeyboard()
not setting WantCaptureKeyboard
#6997
Comments
Keyboard navigation currently always enforces it: // Update io.WantCaptureKeyboard for the user application (true = dispatch keyboard info to Dear ImGui only, false = dispatch keyboard info to Dear ImGui + underlying app)
if (g.WantCaptureKeyboardNextFrame != -1)
io.WantCaptureKeyboard = (g.WantCaptureKeyboardNextFrame != 0);
else
io.WantCaptureKeyboard = (g.ActiveId != 0) || (modal_window != NULL);
if (io.NavActive && (io.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) && !(io.ConfigFlags & ImGuiConfigFlags_NavNoCaptureKeyboard))
io.WantCaptureKeyboard = true; Which perhaps makes the I would need to dig/design further. I'd be also interested in know about your use case for Thanks! |
I hadn't got a specific use case in mind; I found this when browsing the demos trying to understand keyboard capturing and thought it might be a bug. The use case I have that lead me to this was to allow my application to capture keyboard inputs when the mouse is not hovering any ImGui windows; having to click on empty space is cumbersome (as I have an ImGui window for tool selection, and clicking in empty space would apply the newly selected tool, which is not always what the user wants). |
…ed back to true when navigation is enabled. (#6997)
I have pushed 6f171a0 to make an explicit call to |
On the current latest
docking
commit; runningexample_sdl2_opengl3
on Linux Mint.My Issue/Question:
When hovering over (and clicking on) the pink rectangle in the
WantCapture
override demo, with theSetNextFrameWantCaptureKeyboard
toggle set tofalse
,WantCaptureKeyboard
is not actually set tofalse
(which is what I expected).This is not the case for the mouse.
Screenshots/Video
Standalone, minimal, complete and verifiable example: If the demo does not suffice for this I can create one.
The text was updated successfully, but these errors were encountered: