Ignore keyboard shortcuts while TextEdit is active? #3469
-
|
I have a lot of shortcuts in my app that would collide with normal data entry into a TextEdit. How can I capture the active state of my |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
I figured this out. I changed all my |
Beta Was this translation helpful? Give feedback.
-
|
You can use Response::has_focus() (e.g. from ui.add()). |
Beta Was this translation helpful? Give feedback.
I figured this out. I changed all my
TextEdits to use.show(ui), and extracted theTextEditOutput, to check if.cursor_range.is_some(). My app now holds a bool, that Iorall of these values together to check if anyTextEditare active. I reset the bool tofalseon every call ofupdate(), and put my shortcut handling behind anifstatement at the end ofupdate().