Skip to content
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 do I know if microui consumed an event? #18

Closed
prideout opened this issue Oct 19, 2019 · 2 comments
Closed

How do I know if microui consumed an event? #18

prideout opened this issue Oct 19, 2019 · 2 comments

Comments

@prideout
Copy link
Contributor

If the user drags a microui slider in a window, I don't want the drag to affect the content underneath the window. imgui has WantCaptureKeyboard, WantCaptureMouse, etc for this purpose but I can't find the corollary mechanism in microui.

By the way thanks for this library, it's truly beautiful.

@prideout
Copy link
Contributor Author

I think this can be achieved by checking the nullness of hover_root after defining the UI?

@rxi
Copy link
Owner

rxi commented Oct 19, 2019

If ctx->focus is non-zero you can assume microui is capturing keyboard events, if ctx->hover_root is non-zero you can assume microui is capturing mouse events. If you process the events for the underlying content after the call to mu_end() you should be able to use ctx->focus for both keyboard and mouse. Thanks for the kind words!

@rxi rxi closed this as completed Feb 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants