-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
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
How to detect when an item is in text input mode? #3556
Comments
You may use
(linking to #701 for future ref for when we implement it.)
|
Thanks for the response. ImGuiSliderFlags_AlwaysClamp is not a solution for my case. The slider is used as a parameter for a real time audio synthesis process, and jumping to a value which only represents the first two digits typed of a frequency which might be in the range of 20-20000 for example would cause an unwanted glitching of the audio. I will investigate IsItemDeactivated and IsItemDeactivatedAfterEdit. Thanks also for the debugging tip. |
My gut feeling is that applying your value on IsItemDeactivatedAfterEdit() would be adequate but when dragging the slider it would only apply on mouse release.
|
Very nice! |
Version: 1.80 WIP (17905)
Branch: master
Back-ends: imgui_impl_metal.mm + imgui_impl_osx.mm
Compiler: clang/Xcode
Operating System: macos 10.15.4
If I am using SliderFloat and I want to have my app ignore the value while it is being text edited, how do I do that? That is, I want to detect when the widget is in text input mode and not pass the value along to my app while it is being edited. I do want to track the value while the slider is being moved by the mouse. I had thought that IsItemFocused() was the way to do this. But IsItemFocused() does not return true when SliderFloat is in text input mode. Nor does it return true when InputText or InputFloat are in edit mode.
The text was updated successfully, but these errors were encountered: