pub struct Modifiers {
pub shift: bool,
pub control: bool,
pub alt: bool,
pub platform: bool,
}Expand description
Modifier key state.
Fields§
§shift: bool§control: bool§alt: bool§platform: boolThe Windows key / Command key / Super key.
Implementations§
Source§impl Modifiers
impl Modifiers
pub const NONE: Modifiers
Sourcepub fn secondary(&self) -> bool
pub fn secondary(&self) -> bool
The platform’s primary shortcut modifier: Command on macOS, Control elsewhere.
pub fn any(&self) -> bool
Sourcepub fn is_command_like(&self) -> bool
pub fn is_command_like(&self) -> bool
True if any modifier other than shift is held (i.e. this is a shortcut, not text).
Sourcepub fn types_text(&self) -> bool
pub fn types_text(&self) -> bool
Whether a key pressed with these modifiers types its character
instead of acting as a shortcut. Windows reports AltGr (used for
characters like ą or €) as Ctrl+Alt; on macOS Option composes
characters.
Trait Implementations§
impl Copy for Modifiers
impl Eq for Modifiers
impl StructuralPartialEq for Modifiers
Auto Trait Implementations§
impl Freeze 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
Mutably borrows from an owned value. Read more