pub struct Shortcut {
pub key: Key,
pub primary: bool,
pub shift: bool,
pub alt: bool,
}Expand description
A keyboard shortcut: a key, and the modifiers held with it. primary
is ⌘ on macOS and Ctrl elsewhere; alt is ⌥ on macOS.
Fields§
§key: KeyA letter is lower case: Shift is shift.
primary: bool§shift: bool§alt: boolImplementations§
Source§impl Shortcut
impl Shortcut
Sourcepub fn new(key: impl Into<Key>) -> Shortcut
pub fn new(key: impl Into<Key>) -> Shortcut
The key on its own: Shortcut::new(Key::F(2)), or with modifiers
added, Shortcut::new(Key::Up).alt().
Sourcepub fn primary(key: impl Into<Key>) -> Shortcut
pub fn primary(key: impl Into<Key>) -> Shortcut
⌘+key on macOS, Ctrl+key elsewhere: Shortcut::primary('s'),
Shortcut::primary(Key::Backspace).
pub fn shift(self) -> Shortcut
pub fn alt(self) -> Shortcut
Trait Implementations§
impl Copy for Shortcut
impl Eq for Shortcut
impl StructuralPartialEq for Shortcut
Auto Trait Implementations§
impl Forget for Shortcut
impl Freeze for Shortcut
impl Move for Shortcut
impl RefUnwindSafe for Shortcut
impl Send for Shortcut
impl Sync for Shortcut
impl Unpin for Shortcut
impl UnsafeUnpin for Shortcut
impl UnwindSafe for Shortcut
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