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

Help Text for ImGuiIO unclear #1262

Closed
pdJeeves opened this issue Aug 4, 2017 · 1 comment
Closed

Help Text for ImGuiIO unclear #1262

pdJeeves opened this issue Aug 4, 2017 · 1 comment

Comments

@pdJeeves
Copy link

pdJeeves commented Aug 4, 2017

In the help text for ImGuiIO it may mean that I should store the inputs received that frame, then after calling NewFrame() check the WantCaptureMouse and similar fields to determine if I should forward them to the program.

Or it means to query the fields before filling the input, not after calling new frame, and forwarding them immediately if not used. It probably doesn't matter given the short time between frames, but which is the better interpretation?

ocornut added a commit that referenced this issue Aug 5, 2017
@ocornut
Copy link
Owner

ocornut commented Aug 5, 2017

The better interpretation is the first one. As the WantCaptureMouse flag is updated by NewFrame.
The FAQ says:

 Q: How can I tell when ImGui wants my mouse/keyboard inputs and when I can pass them to my application?
 A: You can read the 'io.WantCaptureXXX' flags in the ImGuiIO structure. Preferably read them after calling ImGui::NewFrame() to avoid those flags lagging by one frame, but either should be fine.

But as you pointed out it's not a big issues if you do the second, it will only delay the toggle of WantCaptureMouse which is a hardly noticeable thing.

I have added some clarification to the both parts of the document which refers to those flags, so it should be clearer now (see commit).

@ocornut ocornut closed this as completed Aug 5, 2017
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