-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
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
TreeNode doesn't activate when Ctrl is being held #4692
Comments
May I suggest looking at the range_select branch it should be designed to solve your bigger problem more naturally? This is being maintained and actively used (and should always merge into ( |
Thanks for the quick response, I went with using |
OK, one issue with that, now I wish to use IsItemToggledOpen to prevent chaning selection while opening nodes. This doesn't work since IsItemToggledOpen return true upon clicking the arrow and I change selection when releasing the mouse button which will happen some frames afterwards. To summaize, the following will not work as expected:
|
Please consider looking at the range_select branch.
|
Version/Branch of Dear ImGui:
Version: 1.85 WIP
Branch: docking
Back-end/Renderer/Compiler/OS
Back-ends: imgui_impl_SDL.cpp + imgui_impl_opengl3.cpp
Compiler: VS2019
Operating System: Windows 11
My Issue/Question:
I implemented multi selection in tree nodes by pressing control. Also, I wish to change the selection once the user
releases the mouse button over the tree item. To do so, I've used:
Looking at the code of ImGui::TreeNode, it is hard coded that the button behavior in the tree node uses the flag ImGuiButtonFlags_NoKeyModifiers when the mouse is not over the arrow button, preventing the above code from working (ImGui::IsItemDeactivated never returns true while control is held down)
Is there a workaround I can apply to support both my requirements (multi-select with control, change selection when releasing the button)?
Thanks
Standalone, minimal, complete and verifiable example: (see #2261)
The text was updated successfully, but these errors were encountered: