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

ImGui::GetIO().WantCaptureKeyboard always true when editor opened #83

Closed
Ok23 opened this issue Sep 21, 2020 · 7 comments
Closed

ImGui::GetIO().WantCaptureKeyboard always true when editor opened #83

Ok23 opened this issue Sep 21, 2020 · 7 comments

Comments

@Ok23
Copy link

Ok23 commented Sep 21, 2020

How prevent dispatch events to my main loop ?

@thedmd
Copy link
Owner

thedmd commented Sep 21, 2020

WantCaptureKeyboard mean that ImGui want to consume keyboard input and it should not be passed into underlying engine/game/app.

You need to provide more context about the issue. What is happening? What you expected to happen? Any information that you think may help.

@Ok23
Copy link
Author

Ok23 commented Sep 22, 2020

		ed::SetCurrentEditor(edContext);

		ed::Begin("My Editor");

		int uniqueId = 1;

		// Start drawing nodes.
		ed::BeginNode(uniqueId++);
		ImGui::Text("Node A");
		ed::BeginPin(uniqueId++, ed::PinKind::Input);
		ImGui::Text("-> In");
		ed::EndPin();
		ImGui::SameLine();
		ed::BeginPin(uniqueId++, ed::PinKind::Output);
		ImGui::Text("Out ->");
		ed::EndPin();
		ed::EndNode();

		ed::End();
		if (ImGui::GetIO().WantCaptureKeyboard)
		{
			print("locked");
		}

ImGui::GetIO().WantCaptureKeyboard always true even if node editor window not in focus. How to know when block dispatch keyboard input to my main event loop ?

@thedmd
Copy link
Owner

thedmd commented Oct 13, 2020

Can you comment out in imgui_node_editor.cpp line with ImGui::CaptureKeyboardFromApp() and tell if it behave correctly now?

@Ok23
Copy link
Author

Ok23 commented Oct 13, 2020

Yes, it fix it thanks. But why force to capture keyboard and keyboard navigation in editor still possible ?

@thedmd
Copy link
Owner

thedmd commented Oct 18, 2020

I think call to capture is a leftover. I will remove it since editor does not need text input.

@thedmd thedmd closed this as completed Oct 18, 2020
@SteveWolligandt
Copy link

Hi! Is this actually fixed? I have the same issue and in line 1096 the call to capture is still there. Thanks in advance!

@thedmd
Copy link
Owner

thedmd commented Jan 14, 2021

My apologize. I failed to push that change. It is not fixed on develop.

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

3 participants