pub struct KeyMods {
pub shift: bool,
pub ctrl: bool,
pub alt: bool,
pub super_key: bool,
}Expand description
Physical modifier state. Unlike Mods — which abstracts platform
conventions for the input widget (word, doc) — nothing here is
normalized: an app binding Ctrl-w needs to know it was Control and not
Command.
Fields§
§shift: bool§ctrl: bool§alt: bool§super_key: boolWindows key / Command / Super.
Implementations§
Source§impl KeyMods
impl KeyMods
Sourcepub const SHIFT: u32
pub const SHIFT: u32
Bit 0 Shift, 1 Ctrl, 2 Alt, 3 Super — the order the fields are
declared in, and the C header’s KUI_KMOD_* (pinned there). What
a wire that carries the state as one integer spells it as: the
conformance corpus’s modifiers step, the C input door.
pub const CTRL: u32
pub const ALT: u32
pub const SUPER: u32
Sourcepub const NONE: KeyMods
pub const NONE: KeyMods
No modifier held: what the with_* steps start from —
KeyMods::NONE.with_shift().with_ctrl().
pub const fn with_shift(self) -> Self
pub const fn with_ctrl(self) -> Self
pub const fn with_alt(self) -> Self
pub const fn with_super(self) -> Self
Sourcepub const fn with_primary(self) -> Self
pub const fn with_primary(self) -> Self
The platform primary shortcut modifier held: Command on macOS,
Control elsewhere — the one Self::primary reads.
pub fn from_bits(bits: u32) -> Self
pub fn bits(self) -> u32
pub fn any(self) -> bool
Trait Implementations§
impl Copy for KeyMods
impl Eq for KeyMods
impl StructuralPartialEq 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> 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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
Compare self to
key and return true if they are equal.