mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-01 05:10:41 +00:00
The way to prevent scalar input chars filtering #6810
Labels
No labels
accidentally closed
android
backends
bug
building
clipper
coloredit
color spaces
cplusplus
data types
demo
disabled
doc
docking
dpi
drag drop
drawing/drawlist
dropped
dx12
enhancement
focus
font/text
gallery
help wanted
idle/power saving
ime
in progress
inputs
inputtext
internals
label/id and id stack
language bindings
layout
linux/bsd
menus
multi-contexts
multi-threading
multi-viewports
nav
news/info
opengl
optimization
osx/ios
overlap
plot/graph
popups
question
scrolling
selection
settings
sliders/drags
style
tables/columns
tabs
test wanted
tools
tooltips
tree
tricks & tips
useful widgets
vulkan
web
window pos/depth
window sizing
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ocornut/imgui#6810
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Is there a way to prevent alphabet characters filtering in input/drag scalar?
I find out that there is
ocornut/imgui@6eb2681c09/imgui_widgets.cpp (L3390-L3396)function, that is forced here:
ocornut/imgui@6eb2681c09/imgui_widgets.cpp (L3415)and here:
ocornut/imgui@6eb2681c09/imgui_widgets.cpp (L3460-L3461)one way to hack this behaviour is to define custom function in
IMGUI_USER_CONFIGlike this:so it is used before original one is found.
Is there a native way to it?
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.
Why do you want to input eg arbitrary alphabetical letter in a scalar input field? Why not using InputText() ?
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 ?
Pressing Enter would entirely lose the textual content.
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.
Will need to think about this and ask some users. It should be doable to provide a global setting for that but it also seems interesting to reconsider the current behavior completely.