pub struct KeyMods { /* private fields */ }event only.Expand description
๐ฎ โ A bitfield of key modifiers (Shift, Controlโฆ) + extra (repeating, composing).
๐ ui/event
๐ฆ size_of::<KeyMods>() == 2 bytes / 16 bits
Implementationsยง
Sourceยงimpl KeyMods
impl KeyMods
Sourceยงimpl KeyMods
Named constants
impl KeyMods
Named constants
Sourcepub const SCROLL_LOCK: Self
pub const SCROLL_LOCK: Self
1
The Scroll Lock modifier.
Sourceยงimpl KeyMods
Convenience methods derived from each named constant.
impl KeyMods
Convenience methods derived from each named constant.
Sourcepub const fn has_control(self) -> bool
pub const fn has_control(self) -> bool
Returns true if CONTROL is present.
Sourcepub const fn contains_control(self) -> bool
pub const fn contains_control(self) -> bool
Returns true if all bits in CONTROL are present.
Sourcepub const fn intersects_control(self) -> bool
pub const fn intersects_control(self) -> bool
Returns true if the set shares any bit with CONTROL.
Sourcepub const fn with_control(self) -> Self
pub const fn with_control(self) -> Self
Returns self with CONTROL inserted.
Sourcepub const fn with_control_if(self, condition: bool) -> Self
pub const fn with_control_if(self, condition: bool) -> Self
Returns self with CONTROL inserted if condition is true.
Sourcepub const fn without_control(self) -> Self
pub const fn without_control(self) -> Self
Returns self with CONTROL removed.
Sourcepub const fn set_control(&mut self)
pub const fn set_control(&mut self)
Sets CONTROL.
Sourcepub const fn set_control_if(&mut self, condition: bool)
pub const fn set_control_if(&mut self, condition: bool)
Sets CONTROL if condition is true.
Sourcepub const fn unset_control(&mut self)
pub const fn unset_control(&mut self)
Unsets CONTROL.
Sourcepub const fn contains_shift(self) -> bool
pub const fn contains_shift(self) -> bool
Returns true if all bits in SHIFT are present.
Sourcepub const fn intersects_shift(self) -> bool
pub const fn intersects_shift(self) -> bool
Returns true if the set shares any bit with SHIFT.
Sourcepub const fn with_shift(self) -> Self
pub const fn with_shift(self) -> Self
Returns self with SHIFT inserted.
Sourcepub const fn with_shift_if(self, condition: bool) -> Self
pub const fn with_shift_if(self, condition: bool) -> Self
Returns self with SHIFT inserted if condition is true.
Sourcepub const fn without_shift(self) -> Self
pub const fn without_shift(self) -> Self
Returns self with SHIFT removed.
Sourcepub const fn set_shift_if(&mut self, condition: bool)
pub const fn set_shift_if(&mut self, condition: bool)
Sets SHIFT if condition is true.
Sourcepub const fn unset_shift(&mut self)
pub const fn unset_shift(&mut self)
Unsets SHIFT.
Sourcepub const fn contains_alt(self) -> bool
pub const fn contains_alt(self) -> bool
Returns true if all bits in ALT are present.
Sourcepub const fn intersects_alt(self) -> bool
pub const fn intersects_alt(self) -> bool
Returns true if the set shares any bit with ALT.
Sourcepub const fn with_alt_if(self, condition: bool) -> Self
pub const fn with_alt_if(self, condition: bool) -> Self
Returns self with ALT inserted if condition is true.
Sourcepub const fn without_alt(self) -> Self
pub const fn without_alt(self) -> Self
Returns self with ALT removed.
Sourcepub const fn set_alt_if(&mut self, condition: bool)
pub const fn set_alt_if(&mut self, condition: bool)
Sets ALT if condition is true.
Sourcepub const fn contains_super(self) -> bool
pub const fn contains_super(self) -> bool
Returns true if all bits in SUPER are present.
Sourcepub const fn intersects_super(self) -> bool
pub const fn intersects_super(self) -> bool
Returns true if the set shares any bit with SUPER.
Sourcepub const fn with_super(self) -> Self
pub const fn with_super(self) -> Self
Returns self with SUPER inserted.
Sourcepub const fn with_super_if(self, condition: bool) -> Self
pub const fn with_super_if(self, condition: bool) -> Self
Returns self with SUPER inserted if condition is true.
Sourcepub const fn without_super(self) -> Self
pub const fn without_super(self) -> Self
Returns self with SUPER removed.
Sourcepub const fn set_super_if(&mut self, condition: bool)
pub const fn set_super_if(&mut self, condition: bool)
Sets SUPER if condition is true.
Sourcepub const fn unset_super(&mut self)
pub const fn unset_super(&mut self)
Unsets SUPER.
Sourcepub const fn has_alt_gr(self) -> bool
pub const fn has_alt_gr(self) -> bool
Returns true if ALT_GR is present.
Sourcepub const fn contains_alt_gr(self) -> bool
pub const fn contains_alt_gr(self) -> bool
Returns true if all bits in ALT_GR are present.
Sourcepub const fn intersects_alt_gr(self) -> bool
pub const fn intersects_alt_gr(self) -> bool
Returns true if the set shares any bit with ALT_GR.
Sourcepub const fn with_alt_gr(self) -> Self
pub const fn with_alt_gr(self) -> Self
Returns self with ALT_GR inserted.
Sourcepub const fn with_alt_gr_if(self, condition: bool) -> Self
pub const fn with_alt_gr_if(self, condition: bool) -> Self
Returns self with ALT_GR inserted if condition is true.
Sourcepub const fn without_alt_gr(self) -> Self
pub const fn without_alt_gr(self) -> Self
Returns self with ALT_GR removed.
Sourcepub const fn set_alt_gr(&mut self)
pub const fn set_alt_gr(&mut self)
Sets ALT_GR.
Sourcepub const fn set_alt_gr_if(&mut self, condition: bool)
pub const fn set_alt_gr_if(&mut self, condition: bool)
Sets ALT_GR if condition is true.
Sourcepub const fn unset_alt_gr(&mut self)
pub const fn unset_alt_gr(&mut self)
Unsets ALT_GR.
Sourcepub const fn has_caps_lock(self) -> bool
pub const fn has_caps_lock(self) -> bool
Returns true if CAPS_LOCK is present.
Sourcepub const fn contains_caps_lock(self) -> bool
pub const fn contains_caps_lock(self) -> bool
Returns true if all bits in CAPS_LOCK are present.
Sourcepub const fn intersects_caps_lock(self) -> bool
pub const fn intersects_caps_lock(self) -> bool
Returns true if the set shares any bit with CAPS_LOCK.
Sourcepub const fn with_caps_lock(self) -> Self
pub const fn with_caps_lock(self) -> Self
Returns self with CAPS_LOCK inserted.
Sourcepub const fn with_caps_lock_if(self, condition: bool) -> Self
pub const fn with_caps_lock_if(self, condition: bool) -> Self
Returns self with CAPS_LOCK inserted if condition is true.
Sourcepub const fn without_caps_lock(self) -> Self
pub const fn without_caps_lock(self) -> Self
Returns self with CAPS_LOCK removed.
Sourcepub const fn set_caps_lock(&mut self)
pub const fn set_caps_lock(&mut self)
Sets CAPS_LOCK.
Sourcepub const fn set_caps_lock_if(&mut self, condition: bool)
pub const fn set_caps_lock_if(&mut self, condition: bool)
Sets CAPS_LOCK if condition is true.
Sourcepub const fn unset_caps_lock(&mut self)
pub const fn unset_caps_lock(&mut self)
Unsets CAPS_LOCK.
Sourcepub const fn has_num_lock(self) -> bool
pub const fn has_num_lock(self) -> bool
Returns true if NUM_LOCK is present.
Sourcepub const fn contains_num_lock(self) -> bool
pub const fn contains_num_lock(self) -> bool
Returns true if all bits in NUM_LOCK are present.
Sourcepub const fn intersects_num_lock(self) -> bool
pub const fn intersects_num_lock(self) -> bool
Returns true if the set shares any bit with NUM_LOCK.
Sourcepub const fn with_num_lock(self) -> Self
pub const fn with_num_lock(self) -> Self
Returns self with NUM_LOCK inserted.
Sourcepub const fn with_num_lock_if(self, condition: bool) -> Self
pub const fn with_num_lock_if(self, condition: bool) -> Self
Returns self with NUM_LOCK inserted if condition is true.
Sourcepub const fn without_num_lock(self) -> Self
pub const fn without_num_lock(self) -> Self
Returns self with NUM_LOCK removed.
Sourcepub const fn set_num_lock(&mut self)
pub const fn set_num_lock(&mut self)
Sets NUM_LOCK.
Sourcepub const fn set_num_lock_if(&mut self, condition: bool)
pub const fn set_num_lock_if(&mut self, condition: bool)
Sets NUM_LOCK if condition is true.
Sourcepub const fn unset_num_lock(&mut self)
pub const fn unset_num_lock(&mut self)
Unsets NUM_LOCK.
Sourcepub const fn has_scroll_lock(self) -> bool
pub const fn has_scroll_lock(self) -> bool
Returns true if SCROLL_LOCK is present.
Sourcepub const fn contains_scroll_lock(self) -> bool
pub const fn contains_scroll_lock(self) -> bool
Returns true if all bits in SCROLL_LOCK are present.
Sourcepub const fn intersects_scroll_lock(self) -> bool
pub const fn intersects_scroll_lock(self) -> bool
Returns true if the set shares any bit with SCROLL_LOCK.
Sourcepub const fn with_scroll_lock(self) -> Self
pub const fn with_scroll_lock(self) -> Self
Returns self with SCROLL_LOCK inserted.
Sourcepub const fn with_scroll_lock_if(self, condition: bool) -> Self
pub const fn with_scroll_lock_if(self, condition: bool) -> Self
Returns self with SCROLL_LOCK inserted if condition is true.
Sourcepub const fn without_scroll_lock(self) -> Self
pub const fn without_scroll_lock(self) -> Self
Returns self with SCROLL_LOCK removed.
Sourcepub const fn set_scroll_lock(&mut self)
pub const fn set_scroll_lock(&mut self)
Sets SCROLL_LOCK.
Sourcepub const fn set_scroll_lock_if(&mut self, condition: bool)
pub const fn set_scroll_lock_if(&mut self, condition: bool)
Sets SCROLL_LOCK if condition is true.
Sourcepub const fn unset_scroll_lock(&mut self)
pub const fn unset_scroll_lock(&mut self)
Unsets SCROLL_LOCK.
Sourcepub const fn has_level5(self) -> bool
pub const fn has_level5(self) -> bool
Returns true if LEVEL5 is present.
Sourcepub const fn contains_level5(self) -> bool
pub const fn contains_level5(self) -> bool
Returns true if all bits in LEVEL5 are present.
Sourcepub const fn intersects_level5(self) -> bool
pub const fn intersects_level5(self) -> bool
Returns true if the set shares any bit with LEVEL5.
Sourcepub const fn with_level5(self) -> Self
pub const fn with_level5(self) -> Self
Returns self with LEVEL5 inserted.
Sourcepub const fn with_level5_if(self, condition: bool) -> Self
pub const fn with_level5_if(self, condition: bool) -> Self
Returns self with LEVEL5 inserted if condition is true.
Sourcepub const fn without_level5(self) -> Self
pub const fn without_level5(self) -> Self
Returns self with LEVEL5 removed.
Sourcepub const fn set_level5(&mut self)
pub const fn set_level5(&mut self)
Sets LEVEL5.
Sourcepub const fn set_level5_if(&mut self, condition: bool)
pub const fn set_level5_if(&mut self, condition: bool)
Sets LEVEL5 if condition is true.
Sourcepub const fn unset_level5(&mut self)
pub const fn unset_level5(&mut self)
Unsets LEVEL5.
Sourcepub const fn has_repeating(self) -> bool
pub const fn has_repeating(self) -> bool
Returns true if REPEATING is present.
Sourcepub const fn contains_repeating(self) -> bool
pub const fn contains_repeating(self) -> bool
Returns true if all bits in REPEATING are present.
Sourcepub const fn intersects_repeating(self) -> bool
pub const fn intersects_repeating(self) -> bool
Returns true if the set shares any bit with REPEATING.
Sourcepub const fn with_repeating(self) -> Self
pub const fn with_repeating(self) -> Self
Returns self with REPEATING inserted.
Sourcepub const fn with_repeating_if(self, condition: bool) -> Self
pub const fn with_repeating_if(self, condition: bool) -> Self
Returns self with REPEATING inserted if condition is true.
Sourcepub const fn without_repeating(self) -> Self
pub const fn without_repeating(self) -> Self
Returns self with REPEATING removed.
Sourcepub const fn set_repeating(&mut self)
pub const fn set_repeating(&mut self)
Sets REPEATING.
Sourcepub const fn set_repeating_if(&mut self, condition: bool)
pub const fn set_repeating_if(&mut self, condition: bool)
Sets REPEATING if condition is true.
Sourcepub const fn unset_repeating(&mut self)
pub const fn unset_repeating(&mut self)
Unsets REPEATING.
Sourcepub const fn has_composing(self) -> bool
pub const fn has_composing(self) -> bool
Returns true if COMPOSING is present.
Sourcepub const fn contains_composing(self) -> bool
pub const fn contains_composing(self) -> bool
Returns true if all bits in COMPOSING are present.
Sourcepub const fn intersects_composing(self) -> bool
pub const fn intersects_composing(self) -> bool
Returns true if the set shares any bit with COMPOSING.
Sourcepub const fn with_composing(self) -> Self
pub const fn with_composing(self) -> Self
Returns self with COMPOSING inserted.
Sourcepub const fn with_composing_if(self, condition: bool) -> Self
pub const fn with_composing_if(self, condition: bool) -> Self
Returns self with COMPOSING inserted if condition is true.
Sourcepub const fn without_composing(self) -> Self
pub const fn without_composing(self) -> Self
Returns self with COMPOSING removed.
Sourcepub const fn set_composing(&mut self)
pub const fn set_composing(&mut self)
Sets COMPOSING.
Sourcepub const fn set_composing_if(&mut self, condition: bool)
pub const fn set_composing_if(&mut self, condition: bool)
Sets COMPOSING if condition is true.
Sourcepub const fn unset_composing(&mut self)
pub const fn unset_composing(&mut self)
Unsets COMPOSING.
Sourceยงimpl KeyMods
Common set methods
impl KeyMods
Common set methods
Sourceยงimpl KeyMods
Set operations
impl KeyMods
Set operations
Sourcepub const fn intersects(self, other: Self) -> bool
pub const fn intersects(self, other: Self) -> bool
Returns true if self and other share any bit.
Sourcepub const fn is_subset(self, other: Self) -> bool
pub const fn is_subset(self, other: Self) -> bool
Returns true if all bits in self are also set in other.
Sourcepub const fn is_superset(self, other: Self) -> bool
pub const fn is_superset(self, other: Self) -> bool
Returns true if all bits in other are also set in self.
Sourcepub const fn intersection(self, other: Self) -> Self
pub const fn intersection(self, other: Self) -> Self
Returns the intersection of self and other.
Sourcepub const fn difference(self, other: Self) -> Self
pub const fn difference(self, other: Self) -> Self
Returns the difference of self and other.
Sourcepub const fn symmetric_difference(self, other: Self) -> Self
pub const fn symmetric_difference(self, other: Self) -> Self
Returns the symmetric difference of self and other.
Trait Implementationsยง
Sourceยงimpl BitAndAssign for KeyMods
impl BitAndAssign for KeyMods
Sourceยงfn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
&= operation. Read moreSourceยงimpl BitOrAssign for KeyMods
impl BitOrAssign for KeyMods
Sourceยงfn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
|= operation. Read moreSourceยงimpl BitSized<{ $Set::_SET_BIT_SIZE }> for KeyMods
impl BitSized<{ $Set::_SET_BIT_SIZE }> for KeyMods
Sourceยงconst BIT_SIZE: usize = _
const BIT_SIZE: usize = _
Sourceยงconst MIN_BYTE_SIZE: usize = _
const MIN_BYTE_SIZE: usize = _
Sourceยงfn bit_size(&self) -> usize
fn bit_size(&self) -> usize
Sourceยงfn min_byte_size(&self) -> usize
fn min_byte_size(&self) -> usize
Sourceยงimpl BitXorAssign for KeyMods
impl BitXorAssign for KeyMods
Sourceยงfn bitxor_assign(&mut self, rhs: Self)
fn bitxor_assign(&mut self, rhs: Self)
^= operation. Read moreimpl Copy for KeyMods
Sourceยงimpl DebugExt for KeyMods
impl DebugExt for KeyMods
Sourceยงimpl Display for KeyMods
Formats the set as a prefixed binary mask over its declared bit domain.
impl Display for KeyMods
Formats the set as a prefixed binary mask over its declared bit domain.
impl Eq for KeyMods
Sourceยงimpl LowerHex for KeyMods
Formats the set as a hexadecimal mask over its declared bit domain.
impl LowerHex for KeyMods
Formats the set as a hexadecimal mask over its declared bit domain.
Sourceยงimpl Ord for KeyMods
impl Ord for KeyMods
1.21.0 (const: unstable) ยท Sourceยงfn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Sourceยงimpl PartialOrd for KeyMods
impl PartialOrd for KeyMods
Auto Trait Implementationsยง
impl Freeze for KeyMods
impl RefUnwindSafe for KeyMods
impl Send for KeyMods
impl Sync for KeyMods
impl Unpin for KeyMods
impl UnsafeUnpin for KeyMods
impl UnwindSafe for KeyMods
Blanket Implementationsยง
Sourceยงimpl<T> AnyExt for T
impl<T> AnyExt for T
Sourceยงfn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
fn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
TypeId of Self using a custom hasher.Sourceยงfn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
Sourceยงfn as_any_box(self: Box<Self>) -> Box<dyn Any>where
Self: Sized,
fn as_any_box(self: Box<Self>) -> Box<dyn Any>where
Self: Sized,
alloc only.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> ByteSized for T
impl<T> ByteSized for T
Sourceยงconst BYTE_ALIGN: usize = _
const BYTE_ALIGN: usize = _
Sourceยงfn byte_align(&self) -> usize
fn byte_align(&self) -> usize
Sourceยงfn ptr_size_ratio(&self) -> [usize; 2]
fn ptr_size_ratio(&self) -> [usize; 2]
Sourceยงimpl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Sourceยงimpl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Sourceยงimpl<T> MemExt for Twhere
T: ?Sized,
impl<T> MemExt for Twhere
T: ?Sized,
Sourceยงconst NEEDS_DROP: bool = _
const NEEDS_DROP: bool = _
Sourceยงfn mem_align_of<T>() -> usize
fn mem_align_of<T>() -> usize
Sourceยงfn mem_align_of_val(&self) -> usize
fn mem_align_of_val(&self) -> usize
Sourceยงfn mem_size_of<T>() -> usize
fn mem_size_of<T>() -> usize
Sourceยงfn mem_size_of_val(&self) -> usize
fn mem_size_of_val(&self) -> usize
Sourceยงfn mem_needs_drop(&self) -> bool
fn mem_needs_drop(&self) -> bool
true if dropping values of this type matters. Read moreSourceยงfn mem_forget(self)where
Self: Sized,
fn mem_forget(self)where
Self: Sized,
self without running its destructor. Read moreSourceยงfn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
Sourceยงunsafe fn mem_zeroed<T>() -> T
unsafe fn mem_zeroed<T>() -> T
unsafe_layout only.T represented by the all-zero byte-pattern. Read moreSourceยงunsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe_layout only.T represented by the all-zero byte-pattern. Read moreSourceยงfn mem_as_bytes(&self) -> &[u8] โ
fn mem_as_bytes(&self) -> &[u8] โ
unsafe_slice only.