-
Notifications
You must be signed in to change notification settings - Fork 2
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
Pressing Space in an InputText causes a Enter press (and enter press makes page go back to previous page) #11
Comments
You will probably have to wait for ImGui-Java to update their included imgui version to get the fix as well |
I mean, the version should already be the one with the fix, or at least it says that on the about menu. Funny enough, it works just fine in the about window. |
ImGui was not at fault. So, what basically happend is that the button in the background from the Minecraft GUI that opens the ImGui GUI was still focused and whenever you pressed Enter or Space, it got pressed and the ImGui Window opened again thus going back to the first window. I noticed this when I tried if the same thing happens in an actual Minecraft Instance instead of the development environment (where I had sounds turned off) and I heard the typical Minecraft button "click" sound. By then, I knew something was off and I checked the code. Turns out just removing all the children from the Minecraft Screen was not enough and I also had to defocus any focused element to prevent it from being clicked. I've done this by just re-drawing everything so it loses focus and then removing the children. screen.blur(); was not enough apparently. TL;DR: |
Oh I see, I was already confused but that makes sense, thanks for clarification and sorry for the long response times. |
When pressing space or enter on the keyboard in ImGui, the page jumps back once although it shouldn't. This is especially annoying in ImGui.inputText's since I cannot press space without it going back.
Example code;
This issue has already been addressed in the official ImGui repo and marked as fixed but I do not know how to implement their fix in java.
ocornut/imgui#4552
I see that InputTextFlags.EnterReturnsTrue has been added but that does the exact opposite of what I want to see.
If anyone could help me on this one, that'd be great! Thanks!
The text was updated successfully, but these errors were encountered: