add function is_focused to KeyboardHandle

This commit is contained in:
dragonn 2022-01-09 00:20:50 +01:00 committed by Victor Berger
parent acf26bcaa9
commit 6e0268f407
1 changed files with 5 additions and 0 deletions

View File

@ -469,6 +469,11 @@ impl KeyboardHandle {
.unwrap_or(false)
}
/// Check if keyboard has focus
pub fn is_focused(&self) -> bool {
self.arc.internal.borrow_mut().focus.is_some()
}
/// Register a new keyboard to this handler
///
/// The keymap will automatically be sent to it