-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Accepting input on text field losing 'focus'. #700
Comments
Hi, |
It doesn't behave the same way as Windows or Mac. When tabbing to the next field or click outside the input field, the user doesn't expect their previous input to be reset. The only time it is reset in these OS's is by pressing ESC. For example, open notepad and go to the 'Save As...' dialog box. Enter a filename and press TAB. The filename you enter doesn't disappear. It's not a showstopper, but I do try to aim for the Principle of Least Surprise when it comes to UIs. |
Err, the value should never be reset in ImGui unless you press Esc. If that this the case then it is a bug and that should be fixed instead of adding a new flag.
|
Interesting: in the demo, input float3 works when tab is pressed. Let me On Thu, 16 Jun 2016 at 15:50 omar notifications@github.com wrote:
|
OK, the demo doesn't use the EnterReturnsTrue flag, which is why it works. For example, I change the code in the demo to be:
When you press TAB now, it resets. Without the flag I get it returning true everytime I type a key which is not what I want. I am forced to use the EnterReturnsTrue flag. |
Isn't that the point of that flag? What problem are you trying to solve? |
That flag is the only way to return true once when the input is done with. Currently knowing when the input is done with is when you press 'enter', which is all well and good. However, on modern operating systems, they decide when you've finish editing by 'enter', 'tab' or clicking elsewhere. So, I am guess I am saying I really want this flag:
:) Of course, a ImGuiInputTextFlags_InputDoneReturnsTrue would be more sensible a name! Is it clear what I am getting at? |
Granted, then we'd need a new flag and to rework InputText accordingly. |
Setting the xyz values of an object is something you don't live update on,
|
I'm trying to solve a problem with input text fields. Currently they only return true when enter is pressed (due to ImGuiInputTextFlags_EnterReturnsTrue flag), but I also want it to return true when TAB is pressed to go to next input field, or if the mouse is clicked elsewhere.
A good example of where this is useful is in InputInt3 where pressing TAB is quite natural for people to accept an entry for the first int and move to the next int.
Any advice or is it just not possible with the current implementations?
The text was updated successfully, but these errors were encountered: