pub struct AccessKeyHandler { /* private fields */ }Expand description
Handles access keys for a window.
Implementations§
Source§impl AccessKeyHandler
impl AccessKeyHandler
Sourcepub fn access_key_event() -> &'static RoutedEvent<AccessKeyEventArgs>
pub fn access_key_event() -> &'static RoutedEvent<AccessKeyEventArgs>
Defines the AccessKey event: raised on the element an access key targets.
Sourcepub fn access_key_pressed_event() -> &'static RoutedEvent<AccessKeyPressedEventArgs>
pub fn access_key_pressed_event() -> &'static RoutedEvent<AccessKeyPressedEventArgs>
Defines the AccessKeyPressed event: raised to find the target of an access key.
Source§impl AccessKeyHandler
impl AccessKeyHandler
Sourcepub fn show_access_key_property() -> &'static AttachedProperty<bool>
pub fn show_access_key_property() -> &'static AttachedProperty<bool>
Defines the ShowAccessKey attached property: whether access key markers are shown in a window.
Source§impl AccessKeyHandler
impl AccessKeyHandler
Sourcepub fn new() -> Rc<AccessKeyHandler>
pub fn new() -> Rc<AccessKeyHandler>
Creates an access key handler without an owner.
Sourcepub fn registration_count(&self) -> usize
pub fn registration_count(&self) -> usize
The number of registered access keys, including registrations of elements that are no longer alive and have not been purged yet.
Sourcepub fn registrations(&self) -> Vec<(String, Ref<InputElement>)>
pub fn registrations(&self) -> Vec<(String, Ref<InputElement>)>
The registered access keys with the elements they target (the ones that are still alive). For handlers built on this one.
Sourcepub fn set_owner_with(
&self,
owner: &Ref<InputElement>,
on_set_owner: impl FnOnce(&Ref<InputElement>),
)
pub fn set_owner_with( &self, owner: &Ref<InputElement>, on_set_owner: impl FnOnce(&Ref<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.
Sourcepub fn on_preview_key_down(&self, e: &KeyEventArgs)
pub fn on_preview_key_down(&self, e: &KeyEventArgs)
Called when a key is pressed in the owner window, before the event reaches the focused element.
Sourcepub fn on_key_down(&self, e: &KeyEventArgs)
pub fn on_key_down(&self, e: &KeyEventArgs)
Called when a key is pressed in the owner window.
Sourcepub fn on_preview_key_up(&self, e: &KeyEventArgs)
pub fn on_preview_key_up(&self, e: &KeyEventArgs)
Handles the Alt/F10 keys being released in the window.
Sourcepub fn on_preview_pointer_pressed(&self, _e: &PointerPressedEventArgs)
pub fn on_preview_pointer_pressed(&self, _e: &PointerPressedEventArgs)
Handles a pointer press in the window: hides the access key markers.
Sourcepub fn process_key(
&self,
key: Option<&str>,
element: Option<&Ref<InputElement>>,
) -> bool
pub fn process_key( &self, key: Option<&str>, element: Option<&Ref<InputElement>>, ) -> bool
Processes an access key: raises the AccessKey event on the element the key targets. Returns whether a target was found.
Trait Implementations§
Source§impl IAccessKeyHandler for AccessKeyHandler
impl IAccessKeyHandler for AccessKeyHandler
Source§fn set_owner(&self, owner: &Ref<InputElement>)
fn set_owner(&self, owner: &Ref<InputElement>)
Source§fn register(&self, access_key: &str, element: &Ref<InputElement>)
fn register(&self, access_key: &str, element: &Ref<InputElement>)
Source§fn unregister(&self, element: &InputElement)
fn unregister(&self, element: &InputElement)
Source§impl MarkupTyped for AccessKeyHandler
impl MarkupTyped for AccessKeyHandler
Source§const MARKUP: &'static MarkupType
const MARKUP: &'static MarkupType
Source§impl StaticType for AccessKeyHandler
impl StaticType for AccessKeyHandler
Auto Trait Implementations§
impl !Freeze for AccessKeyHandler
impl !RefUnwindSafe for AccessKeyHandler
impl !Send for AccessKeyHandler
impl !Sync for AccessKeyHandler
impl !UnwindSafe for AccessKeyHandler
impl Unpin for AccessKeyHandler
impl UnsafeUnpin for AccessKeyHandler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more