pub struct KeyboardDevice { /* private fields */ }Expand description
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.
Implementations§
Source§impl KeyboardDevice
impl KeyboardDevice
Sourcepub fn new() -> Rc<KeyboardDevice>
pub fn new() -> Rc<KeyboardDevice>
Creates a keyboard device.
Sourcepub fn instance() -> Option<Rc<KeyboardDevice>>
pub fn instance() -> Option<Rc<KeyboardDevice>>
The keyboard device registered with the locator (as
dyn IKeyboardDevice), if it is a KeyboardDevice.
Sourcepub fn input_manager(&self) -> Option<Rc<dyn IInputManager>>
pub fn input_manager(&self) -> Option<Rc<dyn IInputManager>>
The input manager registered with the locator.
Sourcepub fn focus_manager(&self) -> Option<Rc<dyn IFocusManager>>
pub fn focus_manager(&self) -> Option<Rc<dyn IFocusManager>>
The focus manager registered with the locator.
Sourcepub fn property_changed(
&self,
handler: impl Fn(&str) + 'static,
) -> Rc<dyn IDisposable>
pub fn property_changed( &self, handler: impl Fn(&str) + 'static, ) -> Rc<dyn IDisposable>
Raised with the name of a property of the device that changed
("FocusedElement").
Sourcepub fn focused_element(&self) -> Option<Ref<InputElement>>
pub fn focused_element(&self) -> Option<Ref<InputElement>>
The element that has keyboard focus.
Sourcepub fn set_focused_element(
&self,
element: Option<&Ref<InputElement>>,
method: NavigationMethod,
key_modifiers: KeyModifiers,
)
pub fn set_focused_element( &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.
Sourcepub fn set_focused_element_with(
&self,
element: Option<&Ref<InputElement>>,
method: NavigationMethod,
key_modifiers: KeyModifiers,
is_focus_change_cancellable: bool,
)
pub fn set_focused_element_with( &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§
Source§impl IInputDevice for KeyboardDevice
impl IInputDevice for KeyboardDevice
Source§fn process_raw_event(&self, e: &dyn IRawInputEventArgs)
fn process_raw_event(&self, e: &dyn IRawInputEventArgs)
Source§fn as_pointer_device(&self) -> Option<&dyn IPointerDevice>
fn as_pointer_device(&self) -> Option<&dyn IPointerDevice>
impl IKeyboardDevice for KeyboardDevice
Auto Trait Implementations§
impl !Freeze for KeyboardDevice
impl !RefUnwindSafe for KeyboardDevice
impl !Send for KeyboardDevice
impl !Sync for KeyboardDevice
impl !UnwindSafe for KeyboardDevice
impl Unpin for KeyboardDevice
impl UnsafeUnpin for KeyboardDevice
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