Struct keyboard_types::Modifiers [−]
pub struct Modifiers { /* fields omitted */ }
Pressed modifier keys.
Specification: https://w3c.github.io/uievents-key/#keys-modifier
Methods
impl Modifiers
impl Modifiers
pub const ALT: Modifiers
ALT: Modifiers = Modifiers{bits: 1,}
pub const ALT_GRAPH: Modifiers
ALT_GRAPH: Modifiers = Modifiers{bits: 2,}
pub const CAPS_LOCK: Modifiers
CAPS_LOCK: Modifiers = Modifiers{bits: 4,}
pub const CONTROL: Modifiers
CONTROL: Modifiers = Modifiers{bits: 8,}
pub const FN: Modifiers
FN: Modifiers = Modifiers{bits: 16,}
pub const FN_LOCK: Modifiers
FN_LOCK: Modifiers = Modifiers{bits: 32,}
pub const META: Modifiers
META: Modifiers = Modifiers{bits: 64,}
pub const NUM_LOCK: Modifiers
NUM_LOCK: Modifiers = Modifiers{bits: 128,}
pub const SCROLL_LOCK: Modifiers
SCROLL_LOCK: Modifiers = Modifiers{bits: 256,}
pub const SHIFT: Modifiers
SHIFT: Modifiers = Modifiers{bits: 512,}
pub const SYMBOL: Modifiers
SYMBOL: Modifiers = Modifiers{bits: 1024,}
pub const SYMBOL_LOCK: Modifiers
SYMBOL_LOCK: Modifiers = Modifiers{bits: 2048,}
pub const HYPER: Modifiers
HYPER: Modifiers = Modifiers{bits: 4096,}
pub const SUPER: Modifiers
SUPER: Modifiers = Modifiers{bits: 8192,}
pub fn empty() -> Modifiers
pub fn empty() -> Modifiers
Returns an empty set of flags.
pub fn all() -> Modifiers
pub fn all() -> Modifiers
Returns the set containing all flags.
pub fn bits(&self) -> u32
pub fn bits(&self) -> u32
Returns the raw value of the flags currently stored.
pub fn from_bits(bits: u32) -> Option<Modifiers>
pub fn from_bits(bits: u32) -> Option<Modifiers>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
pub fn from_bits_truncate(bits: u32) -> Modifiers
pub fn from_bits_truncate(bits: u32) -> Modifiers
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
pub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true
if no flags are currently stored.
pub fn is_all(&self) -> bool
pub fn is_all(&self) -> bool
Returns true
if all flags are currently set.
pub fn intersects(&self, other: Modifiers) -> bool
pub fn intersects(&self, other: Modifiers) -> bool
Returns true
if there are flags common to both self
and other
.
pub fn contains(&self, other: Modifiers) -> bool
pub fn contains(&self, other: Modifiers) -> bool
Returns true
all of the flags in other
are contained within self
.
pub fn insert(&mut self, other: Modifiers)
pub fn insert(&mut self, other: Modifiers)
Inserts the specified flags in-place.
pub fn remove(&mut self, other: Modifiers)
pub fn remove(&mut self, other: Modifiers)
Removes the specified flags in-place.
pub fn toggle(&mut self, other: Modifiers)
pub fn toggle(&mut self, other: Modifiers)
Toggles the specified flags in-place.
pub fn set(&mut self, other: Modifiers, value: bool)
pub fn set(&mut self, other: Modifiers, value: bool)
Inserts or removes the specified flags depending on the passed value.
Trait Implementations
impl Copy for Modifiers
impl Copy for Modifiers
impl PartialEq for Modifiers
impl PartialEq for Modifiers
fn eq(&self, other: &Modifiers) -> bool
fn eq(&self, other: &Modifiers) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Modifiers) -> bool
fn ne(&self, other: &Modifiers) -> bool
This method tests for !=
.
impl Eq for Modifiers
impl Eq for Modifiers
impl Clone for Modifiers
impl Clone for Modifiers
fn clone(&self) -> Modifiers
fn clone(&self) -> Modifiers
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl PartialOrd for Modifiers
impl PartialOrd for Modifiers
fn partial_cmp(&self, other: &Modifiers) -> Option<Ordering>
fn partial_cmp(&self, other: &Modifiers) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Modifiers) -> bool
fn lt(&self, other: &Modifiers) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Modifiers) -> bool
fn le(&self, other: &Modifiers) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Modifiers) -> bool
fn gt(&self, other: &Modifiers) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Modifiers) -> bool
fn ge(&self, other: &Modifiers) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for Modifiers
impl Ord for Modifiers
fn cmp(&self, other: &Modifiers) -> Ordering
fn cmp(&self, other: &Modifiers) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl Hash for Modifiers
impl Hash for Modifiers
fn hash<__H: Hasher>(&self, state: &mut __H)
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Default for Modifiers
[src]
impl Default for Modifiers
impl Debug for Modifiers
impl Debug for Modifiers
impl Binary for Modifiers
impl Binary for Modifiers
impl Octal for Modifiers
impl Octal for Modifiers
impl LowerHex for Modifiers
impl LowerHex for Modifiers
impl UpperHex for Modifiers
impl UpperHex for Modifiers
impl BitOr for Modifiers
impl BitOr for Modifiers
type Output = Modifiers
The resulting type after applying the |
operator.
fn bitor(self, other: Modifiers) -> Modifiers
fn bitor(self, other: Modifiers) -> Modifiers
Returns the union of the two sets of flags.
impl BitOrAssign for Modifiers
impl BitOrAssign for Modifiers
fn bitor_assign(&mut self, other: Modifiers)
fn bitor_assign(&mut self, other: Modifiers)
Adds the set of flags.
impl BitXor for Modifiers
impl BitXor for Modifiers
type Output = Modifiers
The resulting type after applying the ^
operator.
fn bitxor(self, other: Modifiers) -> Modifiers
fn bitxor(self, other: Modifiers) -> Modifiers
Returns the left flags, but with all the right flags toggled.
impl BitXorAssign for Modifiers
impl BitXorAssign for Modifiers
fn bitxor_assign(&mut self, other: Modifiers)
fn bitxor_assign(&mut self, other: Modifiers)
Toggles the set of flags.
impl BitAnd for Modifiers
impl BitAnd for Modifiers
type Output = Modifiers
The resulting type after applying the &
operator.
fn bitand(self, other: Modifiers) -> Modifiers
fn bitand(self, other: Modifiers) -> Modifiers
Returns the intersection between the two sets of flags.
impl BitAndAssign for Modifiers
impl BitAndAssign for Modifiers
fn bitand_assign(&mut self, other: Modifiers)
fn bitand_assign(&mut self, other: Modifiers)
Disables all flags disabled in the set.
impl Sub for Modifiers
impl Sub for Modifiers
type Output = Modifiers
The resulting type after applying the -
operator.
fn sub(self, other: Modifiers) -> Modifiers
fn sub(self, other: Modifiers) -> Modifiers
Returns the set difference of the two sets of flags.
impl SubAssign for Modifiers
impl SubAssign for Modifiers
fn sub_assign(&mut self, other: Modifiers)
fn sub_assign(&mut self, other: Modifiers)
Disables all flags enabled in the set.
impl Not for Modifiers
impl Not for Modifiers
type Output = Modifiers
The resulting type after applying the !
operator.
fn not(self) -> Modifiers
fn not(self) -> Modifiers
Returns the complement of this set of flags.
impl Extend<Modifiers> for Modifiers
impl Extend<Modifiers> for Modifiers
fn extend<T: IntoIterator<Item = Modifiers>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = Modifiers>>(&mut self, iterator: T)
Extends a collection with the contents of an iterator. Read more
impl FromIterator<Modifiers> for Modifiers
impl FromIterator<Modifiers> for Modifiers
fn from_iter<T: IntoIterator<Item = Modifiers>>(iterator: T) -> Modifiers
fn from_iter<T: IntoIterator<Item = Modifiers>>(iterator: T) -> Modifiers
Creates a value from an iterator. Read more