KeyboardDevice
struct · ferroui-base · v0.5.0
struct KeyboardDevice
Represents the keyboard: turns raw key and text input into routed events on the focused element, and is the source of truth about which element has keyboard focus.
Members
newinstanceinput_managerfocus_managerproperty_changedfocused_elementset_focused_elementset_focused_element_with
new
fn new() -> Rc<KeyboardDevice>
Creates a keyboard device.
instance
fn instance() -> Option<Rc<KeyboardDevice>>
The keyboard device registered with the locator (as
dyn IKeyboardDevice), if it is a KeyboardDevice.
input_manager
fn input_manager(self: &Self) -> Option<Rc<dyn IInputManager>>
The input manager registered with the locator.
focus_manager
fn focus_manager(self: &Self) -> Option<Rc<dyn IFocusManager>>
The focus manager registered with the locator.
property_changed
fn property_changed(self: &Self, handler: impl Fn(&str) -> () + 'static) -> Subscription
Raised with the name of a property of the device that changed
("FocusedElement"). Dropping the returned guard removes the
handler; Subscription::detach keeps it for the life of the
device.
focused_element
fn focused_element(self: &Self) -> Option<Ref<InputElement>>
The element that has keyboard focus.
set_focused_element
fn set_focused_element(self: &Self, element: Option<&Ref<InputElement>>, method: NavigationMethod, key_modifiers: KeyModifiers)
Moves keyboard focus to an element (or clears it); the change can be
cancelled or redirected by LosingFocus/GettingFocus handlers.
set_focused_element_with
fn set_focused_element_with(self: &Self, element: Option<&Ref<InputElement>>, method: NavigationMethod, key_modifiers: KeyModifiers, is_focus_change_cancellable: bool)
Moves keyboard focus to an element (or clears it).
is_focus_change_cancellable tells whether LosingFocus and
GettingFocus handlers may cancel or redirect the change.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeClassDefaultsBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyErasedDestructorIntoEitherIInputDeviceIKeyboardDevice
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.