Skip to main content

AccessKeyHandler

Struct AccessKeyHandler 

Source
pub struct AccessKeyHandler { /* private fields */ }
Expand description

Handles access keys for a window.

Implementations§

Source§

impl AccessKeyHandler

Source

pub const TYPE: &'static TypeInfo = <AccessKeyHandler as crate::StaticType>::TYPE

The runtime type of this type.

Source§

impl AccessKeyHandler

Source

pub fn access_key_event() -> &'static RoutedEvent<AccessKeyEventArgs>

Defines the AccessKey event: raised on the element an access key targets.

Source

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

Source

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

Source

pub fn new() -> Rc<AccessKeyHandler>

Creates an access key handler without an owner.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn on_key_down(&self, e: &KeyEventArgs)

Called when a key is pressed in the owner window.

Source

pub fn on_preview_key_up(&self, e: &KeyEventArgs)

Handles the Alt/F10 keys being released in the window.

Source

pub fn on_preview_pointer_pressed(&self, _e: &PointerPressedEventArgs)

Handles a pointer press in the window: hides the access key markers.

Source

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

Source§

fn main_menu(&self) -> Option<Rc<dyn IMainMenu>>

The window’s main menu.
Source§

fn set_main_menu(&self, value: Option<Rc<dyn IMainMenu>>)

Sets the window’s main menu.
Source§

fn set_owner(&self, owner: &Ref<InputElement>)

Sets the owner of the access key handler. Read more
Source§

fn register(&self, access_key: &str, element: &Ref<InputElement>)

Registers an input element to be associated with an access key.
Source§

fn unregister(&self, element: &InputElement)

Unregisters the access keys associated with the input element.
Source§

impl MarkupTyped for AccessKeyHandler

Source§

const MARKUP: &'static MarkupType

The markup metadata of the type.
Source§

impl StaticType for AccessKeyHandler

Source§

const TYPE: &'static TypeInfo

The runtime type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ClassDefaults for T
where T: ?Sized,

Source§

fn static_constructor()

The static constructor of a type: work done once per thread, after the properties of the type are registered and before its first instance exists (class handlers, affects_render, metadata overrides). Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.