#[repr(C)]pub struct Shortcut {
pub key: Key,
pub shift: bool,
pub alt: bool,
}Expand description
A keyboard shortcut: the platform’s command key, Cmd on macOS and Ctrl on Windows,
with key, and Shift or Alt (Option on macOS) when set. repr(C) because compiled
apps store it as is.
Fields§
§key: Key§shift: bool§alt: boolImplementations§
Source§impl Shortcut
impl Shortcut
pub const fn command(key: Key) -> Self
Sourcepub fn parse(text: &str) -> Result<Self, ShortcutError>
pub fn parse(text: &str) -> Result<Self, ShortcutError>
Reads a shortcut as code writes it: its modifiers, then its key, joined by +,
such as "n" or "shift+n".
§Errors
When a part is no modifier or key, or a modifier is written twice.
Sourcepub fn taken_by(self) -> Option<SystemCommand>
pub fn taken_by(self) -> Option<SystemCommand>
The system command that already uses this shortcut, if one does.
Trait Implementations§
impl Copy for Shortcut
impl Eq for Shortcut
impl StructuralPartialEq for Shortcut
Auto Trait Implementations§
impl Freeze 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