mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-01 05:10:41 +00:00
InputText : how to force ENTER/validation while the widget is active ? #3290
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#3290
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?
Version: Dear ImGui 1.77 WIP (17601)
Branch: master
Back-ends: SFML
Compiler: VS2019 c++
Operating System: win10x64
Hi Omar @ocornut
I use an Inputtext widget, and in some cases, while the user is editing the text, I need to force the widget to lose Keyboard focus and validate its current state (as if the user was pressing ENTER).
Is there a way to do that ?
InputText()will update the underlying character data while inputting so it should always be up to date.Would be good to know more about your context, calling
ClearActiveID()is one way to clear focus on theInputText()(which is not what you asked for but I feel is likely what you need).Thx Omar ! Once again you did a very good job finding out what I really need. ClearActiveID() works perfectly for me.
Th exact problem was: in some occasion this InputText MUST be filled with a new value, even if the user is working on it. And for the moment, if the user was editing it, I was not able to change the underlying value, and the result was all messed up and not logical. Now, I just have to ClearActiveID to get back the control of this InputText , and everything can work as intended.
Linking to #2881, #2890