Add Response::has_kb_focus()
Closes
@@ -60,7 +60,7 @@ pub struct Response {
/// `None` if the widget is not being interacted with.
pub(crate) interact_pointer_pos: Option<Pos2>,
- /// This widget has the keyboard focus (i.e. is receiving key pressed).
+ /// This widget has the keyboard focus (i.e. is receiving key presses).
pub(crate) has_kb_focus: bool,
/// The widget had keyboard focus and lost it.
@@ -145,6 +145,11 @@ impl Response {
self.hovered
}
+ /// This widget has the keyboard focus (i.e. is receiving key presses).
+ pub fn has_kb_focus(&self) -> bool {
+ self.has_kb_focus
+ }
+
/// The widget had keyboard focus and lost it,
/// perhaps because the user pressed enter.
/// If you want to do an action when a user presses enter in a text field,
