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

Question about event handling #446

Closed
jukea opened this issue Dec 18, 2015 · 4 comments
Closed

Question about event handling #446

jukea opened this issue Dec 18, 2015 · 4 comments

Comments

@jukea
Copy link

jukea commented Dec 18, 2015

Hi,

As far as I've seen, example integrations don't show any way to have the app handle "left over" events, not captured by imgui. For example, I would have expected ImGui_ImplDX11_WndProcHandler to "grab" a mouse event only if it occurs inside a imgui window.

To use the mouse to move a camera in a 3d scene, I had to let my app peek at all events, even if they were in fact "belonging" to imgui. This causes the camera to move even for clicks in imgui windows.

What would be a correct pattern to handle correct event passing between imgui and host app ?

thanks

@ocornut
Copy link
Owner

ocornut commented Dec 18, 2015

There is a flag io.WantMouseCapture that tells you if ImGui wants inputs based on the mouse position you gave it. Same for keyboard.

@jukea
Copy link
Author

jukea commented Dec 18, 2015

Hm but in what file is this ? I'm doing a global text search in the master branch and I find no occurence of "WantMouseCapture" .

@jukea
Copy link
Author

jukea commented Dec 18, 2015

Ok found it, it's named "WantCaptureMouse", thanks !

@ocornut
Copy link
Owner

ocornut commented Dec 19, 2015

Sorry yes, mistyped that out of memory. Out of curiosity have you read the comments/instructions in imgui.cpp? You are right that I should add a reference to those fields in the example application to make the information more accessible. I'll add that to my notes.

Let us know how that works.

@ocornut ocornut closed this as completed Dec 19, 2015
ocornut added a commit that referenced this issue Nov 1, 2017
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