-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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
How to setup the mouse handler or mouse event of ImGui background? (use io.WantCaptureMouse) #4664
Comments
This is incorrect you should NEVER write to this value. None of our comments and documentation suggests to do that. Use You don't need anything more. Display the value and you will understand it then you can use it.
|
Based on your code above:
You should simply do:
But I worry that you are using this code this is already done by SDL backend you shouldn't have to call those function. |
@ocornut, thank you very much, it instantly solves the problem with a little fix of course. |
@ocornut, I want to thank that I 100% followed the advices, and I want to prove that I love perfection, I spent a few hours because my code had annoying bug before, but it's fixed, I use SDL you were talking about because the mouse double click behavior is very difficult to rebuild from scratch, and SDL gets the Operating System's mouse double click speed too. The io.WantCaptureMouse is fully functional with a little fix. And the code below works perfectly without any bug.
|
Version/Branch of Dear ImGui:
Version: v1.84
Back-end/Renderer/Compiler/OS
Back-ends: imgui_impl_sdl.cpp + imgui_impl_vulkan.cpp
Compiler: Visual Studio 2015
Operating System: Windows 10
My Issue/Question:
The real question is at the bottom of this paragraph. But the cause the issue is I use the code below:
Code I read somewhere:
The code below is from: https://github.com/ocornut/imgui/blob/master/docs/FAQ.md#q-how-can-i-tell-whether-to-dispatch-mousekeyboard-to-dear-imgui-or-my-application
My question is how to make the function MyLowLevelMouseButtonHandler to be the ImGui background mouse handler? Background means that there should not be mouse event on any ImGui window (see the red [error] in the Video Gif), except if the mouse clicks drag on the background and hovers above an ImGui window. I tried to read the documentation in the link but it doesn't talk about how setup the mouse handler.
Advanced details of my project
ImGui is my life, without it, I'm nothing. So please answer, thanks.
The text was updated successfully, but these errors were encountered: