AccessKeyHandler
struct · ferroui-base · v0.5.0
struct AccessKeyHandler
Handles access keys for a window.
Members
TYPEaccess_key_eventaccess_key_pressed_eventshow_access_key_propertynewregistration_countregistrationsset_owner_withon_preview_key_downon_key_downon_preview_key_upon_preview_pointer_pressedprocess_key
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this type.
access_key_event
fn access_key_event() -> &'static RoutedEvent<AccessKeyEventArgs>
Defines the AccessKey event: raised on the element an access key targets.
access_key_pressed_event
fn access_key_pressed_event() -> &'static RoutedEvent<AccessKeyPressedEventArgs>
Defines the AccessKeyPressed event: raised to find the target of an access key.
show_access_key_property
fn show_access_key_property() -> &'static AttachedProperty<bool>
Defines the ShowAccessKey attached property: whether access key markers are shown in a window.
new
fn new() -> Rc<AccessKeyHandler>
Creates an access key handler without an owner.
registration_count
fn registration_count(self: &Self) -> usize
The number of registered access keys, including registrations of elements that are no longer alive and have not been purged yet.
registrations
fn registrations(self: &Self) -> Vec<(String, crate::Ref<super::InputElement>)>
The registered access keys with the elements they target (the ones that are still alive). For handlers built on this one.
set_owner_with
fn set_owner_with(self: &Self, owner: &crate::Ref<super::InputElement>, on_set_owner: impl FnOnce(&crate::Ref<super::InputElement>) -> ())
Sets the owner of the handler as IAccessKeyHandler::set_owner does, with the key
and pointer handlers attached, and then runs on_set_owner: the OnSetOwner virtual
of the class, which does nothing in this class and which a handler built on this one
overrides (the handler of a menu item attaches its text input handler there).
This method can only be called once.
on_preview_key_down
fn on_preview_key_down(self: &Self, e: &KeyEventArgs)
Called when a key is pressed in the owner window, before the event reaches the focused element.
on_key_down
fn on_key_down(self: &Self, e: &KeyEventArgs)
Called when a key is pressed in the owner window.
on_preview_key_up
fn on_preview_key_up(self: &Self, e: &KeyEventArgs)
Handles the Alt/F10 keys being released in the window.
on_preview_pointer_pressed
fn on_preview_pointer_pressed(self: &Self, _e: &PointerPressedEventArgs)
Handles a pointer press in the window: hides the access key markers.
process_key
fn process_key(self: &Self, key: Option<&str>, element: Option<&crate::Ref<super::InputElement>>) -> bool
Processes an access key: raises the AccessKey event on the element the key targets. Returns whether a target was found.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeClassDefaultsBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyErasedDestructorIntoEitherStaticTypeIAccessKeyHandlerMarkupTyped
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.