-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
The way to prevent scalar input chars filtering #6810
Comments
Could you explain why would you want to do that ? |
We think of it like a possible option for better UX |
You are not answering the question. We can’t provide you with a right answer if you don’t explain your use case. |
I want it to have drag behaviour and to have numerical argiments, but also I want it not to "ignore" user writing alphabet symbols (accidentaly or specialy) |
You are not answering the question which is WHY do you want that? What do you expect to happen with the DragFloat() when text character are entered, value set to 0.0f ? |
I think it should hold last valid value, at least with the hack I use it works this way, it would be nice to have ability to check explicitly if input is valid or not |
You have not answered the question yet. I would appreciate if you did, at least if you expect an answer. |
Our users complain that our Dear ImGui based application behaves not like other applications in numeric edit boxes. When they by mistake enter not digits (e.g. due to special language settings on their keybords), nothing appears on the screen, and it looks to them that the appliation does not respond at all. That is why we want to show all entered text in numeric edit fields even if it is invalid |
Thank you. I understand better. |
Did some soul searching and applied this change now :) |
…characters during text editing. (ocornut#6810, ocornut#7096)
Thanks! |
I have also been coincidentally looking for a similar feature, so that change is very timely, thanks! My motivation is that I want users to be able to enter NAN or INF which filtering on chars prevents. I happen to be on the docking branch where those changes are not present yet.
|
Roughly every week or two weeks, depending on commits contents.
I am not happy with the code quality so I aim to rewrite it a third time first, see https://github.com/ocornut/imgui/wiki/Docking#why-is-not-merged-to-master One of the reason for building the imgui test suite (https://github.com/ocornut/imgui_test_engine) was to get more coverage of docking features to facilitate the rewrite. Code is imho too brittle currently. |
Is there a way to prevent alphabet characters filtering in input/drag scalar?
I find out that there is
imgui/imgui_widgets.cpp
Lines 3390 to 3396 in 6eb2681
function, that is forced here:
imgui/imgui_widgets.cpp
Line 3415 in 6eb2681
and here:
imgui/imgui_widgets.cpp
Lines 3460 to 3461 in 6eb2681
one way to hack this behaviour is to define custom function in
IMGUI_USER_CONFIG
like this:so it is used before original one is found.
Is there a native way to it?
The text was updated successfully, but these errors were encountered: