Imgui: Know if active widget is an InputText

Created on 7 Jul 2017  Â·  2Comments  Â·  Source: ocornut/imgui

I'm working on an editor for a game where, when I press delete, the selected objects should be destroyed unless an InputText widget is active. I don't want to be editing some string property of an object, press delete to remove a character and destroy the object instead. I can use ImGui::IsAnyItemActive to know if there's an active widget, but I don't have any clue about what the item is, so that would cause false positives. Is there a way of knowing if a widget of type InputText is active?

Thanks in advance

Most helpful comment

Are you sure what you need isn't the existing io.WantCaptureKeyboard flag?

On 7 Jul 2017, at 21:29, Lugruf notifications@github.com wrote:

I'm working on an editor for a game where, when I press delete, the selected objects should be destroyed unless an InputText widget is active. I don't want to be editing some string property of an object, press delete to remove a character and destroy the object instead. I can use ImGui::IsAnyItemActive to know if there's an active widget, but I don't have any clue about what the item is, so that would cause false positives. Is there a way of knowing if a widget of type InputText is active?

Thanks in advance

―
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

All 2 comments

Are you sure what you need isn't the existing io.WantCaptureKeyboard flag?

On 7 Jul 2017, at 21:29, Lugruf notifications@github.com wrote:

I'm working on an editor for a game where, when I press delete, the selected objects should be destroyed unless an InputText widget is active. I don't want to be editing some string property of an object, press delete to remove a character and destroy the object instead. I can use ImGui::IsAnyItemActive to know if there's an active widget, but I don't have any clue about what the item is, so that would cause false positives. Is there a way of knowing if a widget of type InputText is active?

Thanks in advance

―
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

It was exactly that. Thank you very much

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bizehao picture bizehao  Â·  3Comments

KaungZawHtet picture KaungZawHtet  Â·  3Comments

the-lay picture the-lay  Â·  3Comments

ILoveImgui picture ILoveImgui  Â·  3Comments

namuda picture namuda  Â·  3Comments