pub struct Modifiers(/* private fields */);Expand description
The keyboard modifiers held at an interaction: what a KeyEvent carries and what
day::modifiers() answers ambiently (Toolkit::modifiers). A small set with a method
per key: event.modifiers.shift(), Modifiers::PRIMARY | Modifiers::SHIFT.
Touch-only backends answer Modifiers::NONE.
Modifiers::bits is the mask a backend’s numeric wire carries
(bridge::BridgeKind::Key), and Modifiers::from_bits reads it back.
Implementations§
Source§impl Modifiers
impl Modifiers
Sourcepub const PRIMARY: Modifiers
pub const PRIMARY: Modifiers
The platform’s command key: ⌘ on Apple platforms, Ctrl elsewhere (the
Shortcut::primary convention).
Sourcepub const CONTROL: Modifiers
pub const CONTROL: Modifiers
The Control key itself, wherever it sits: on Apple platforms it is a different key
from Modifiers::PRIMARY (⌘), elsewhere the same one, so a Ctrl+C on Linux sets
both. Carried by key events on the full route (Decorate::keyboard).
Sourcepub const fn bits(self) -> u8
pub const fn bits(self) -> u8
The wire mask: one bit per modifier, in declaration order from bit 0.
Sourcepub const fn from_bits(bits: u8) -> Modifiers
pub const fn from_bits(bits: u8) -> Modifiers
The set a wire mask spells; bits above the four modifiers are ignored.
Trait Implementations§
Source§impl BitOrAssign for Modifiers
impl BitOrAssign for Modifiers
Source§fn bitor_assign(&mut self, rhs: Modifiers)
fn bitor_assign(&mut self, rhs: Modifiers)
|= operation. Read moreimpl Copy for Modifiers
impl Eq for Modifiers
Source§impl From<u8> for Modifiers
A wire mask (Modifiers::from_bits): what a backend’s key trampoline holds.
impl From<u8> for Modifiers
A wire mask (Modifiers::from_bits): what a backend’s key trampoline holds.
impl StructuralPartialEq for Modifiers
Auto Trait Implementations§
impl Forget for Modifiers
impl Freeze for Modifiers
impl Move for Modifiers
impl RefUnwindSafe for Modifiers
impl Send for Modifiers
impl Sync for Modifiers
impl Unpin for Modifiers
impl UnsafeUnpin for Modifiers
impl UnwindSafe for Modifiers
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> 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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more