Skip to main content

text_input_owns_keyboard

Function text_input_owns_keyboard 

Source
pub fn text_input_owns_keyboard(ctx: &Context) -> bool
Expand description

Whether a text input owns the keyboard: a text field has the focus, or an open input claimed it (claim_keyboard) this pass or the last. egui-pop’s key dispatcher then leaves Escape and Enter (without Ctrl or Alt) to the input; a host with a dispatcher of its own, or one that reads Escape before the widgets are drawn, should ask this first and do the same.

The claim matters for Escape: egui lets go of the focus when Escape is pressed, before the pass is drawn, so on that pass no text field has the focus any more.