pub struct ModifiersState {
pub ctrl: bool,
pub alt: bool,
pub shift: bool,
pub caps_lock: bool,
pub logo: bool,
pub num_lock: bool,
pub iso_level3_shift: bool,
pub iso_level5_shift: bool,
pub serialized: SerializedMods,
}
Expand description
Represents the current state of the keyboard modifiers
Each field of this struct represents a modifier and is true
if this modifier is active.
For some modifiers, this means that the key is currently pressed, others are toggled (like caps lock).
Fields§
§ctrl: bool
The “control” key
alt: bool
The “alt” key
shift: bool
The “shift” key
caps_lock: bool
The “Caps lock” key
logo: bool
The “logo” key
Also known as the “windows” key on most keyboards
num_lock: bool
The “Num lock” key
iso_level3_shift: bool
The “ISO level 3 shift” key
Also known as the “AltGr” key
iso_level5_shift: bool
The “ISO level 5 shift” key
serialized: SerializedMods
Serialized modifier state, as send e.g. by the wl_keyboard protocol
Implementations§
Source§impl ModifiersState
impl ModifiersState
Sourcepub fn update_with(&mut self, state: &State)
pub fn update_with(&mut self, state: &State)
Update the modifiers state from an xkb state
Trait Implementations§
Source§impl Clone for ModifiersState
impl Clone for ModifiersState
Source§fn clone(&self) -> ModifiersState
fn clone(&self) -> ModifiersState
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 ModifiersState
impl Debug for ModifiersState
Source§impl Default for ModifiersState
impl Default for ModifiersState
Source§fn default() -> ModifiersState
fn default() -> ModifiersState
Returns the “default value” for a type. Read more
Source§impl Hash for ModifiersState
impl Hash for ModifiersState
Source§impl PartialEq for ModifiersState
impl PartialEq for ModifiersState
impl Copy for ModifiersState
impl Eq for ModifiersState
impl StructuralPartialEq for ModifiersState
Auto Trait Implementations§
impl Freeze for ModifiersState
impl RefUnwindSafe for ModifiersState
impl Send for ModifiersState
impl Sync for ModifiersState
impl Unpin for ModifiersState
impl UnwindSafe for ModifiersState
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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.