pub struct ModifierState { /* private fields */ }
Expand description
Tracks the current state of “significant” modifier keys.
Currently, a modifier key is “significant” if it affects the mapping of a Fuchsia key to a key meaning.
Implementations§
Source§impl ModifierState
impl ModifierState
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new ModifierState initializes with the default state (no modifiers are actuated).
Sourcepub fn with(self, value: Modifiers) -> Self
pub fn with(self, value: Modifiers) -> Self
Unconditionally adds the given modifier into the modifier state as actuated.
Returns Self
for chaining.
Sourcepub fn with_if(self, value: Modifiers, set: bool) -> Self
pub fn with_if(self, value: Modifiers, set: bool) -> Self
Adds modifier
into the modifier state as actuated, if set
is true.
Otherwise makes no changes to ModifierState.
Returns Self
for chaining.
Sourcepub fn update(&mut self, event: KeyEventType, key: Key)
pub fn update(&mut self, event: KeyEventType, key: Key)
Update the modifier tracker state with this event.
Sourcepub fn update_with_key_meaning(
&mut self,
event: KeyEventType,
key_meaning: KeyMeaning,
)
pub fn update_with_key_meaning( &mut self, event: KeyEventType, key_meaning: KeyMeaning, )
Update the modifier tracker with this event.
Trait Implementations§
Source§impl Clone for ModifierState
impl Clone for ModifierState
Source§fn clone(&self) -> ModifierState
fn clone(&self) -> ModifierState
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ModifierState
impl Debug for ModifierState
Source§impl Default for ModifierState
impl Default for ModifierState
Source§impl Hash for ModifierState
impl Hash for ModifierState
Source§impl ModifierChecker for ModifierState
impl ModifierChecker for ModifierState
Source§impl PartialEq for ModifierState
impl PartialEq for ModifierState
impl Copy for ModifierState
impl Eq for ModifierState
impl StructuralPartialEq for ModifierState
Auto Trait Implementations§
impl Freeze for ModifierState
impl RefUnwindSafe for ModifierState
impl Send for ModifierState
impl Sync for ModifierState
impl Unpin for ModifierState
impl UnwindSafe for ModifierState
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)