pub struct Modifiers {
pub shift: bool,
pub control: bool,
pub alt: bool,
pub meta: bool,
}Expand description
The keyboard modifiers held during an input event.
Fields§
§shift: boolWhether Shift is held.
control: boolWhether Control is held.
alt: boolWhether Alt is held.
meta: boolWhether the Meta key is held, the Command key on macOS and the Super key elsewhere.
Implementations§
Source§impl Modifiers
impl Modifiers
Sourcepub fn command(&self) -> bool
pub fn command(&self) -> bool
Returns whether the platform’s command modifier is held.
This is meta on macOS and control everywhere else, so a shortcut
reads the same on every platform.
§Examples
use smudge_core::input::Modifiers;
let modifiers = Modifiers {
control: true,
..Modifiers::default()
};
#[cfg(not(target_os = "macos"))]
assert!(modifiers.command());Trait Implementations§
impl Copy for Modifiers
impl Eq for Modifiers
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
Mutably borrows from an owned value. Read more