pub struct Shortcut {
pub modifiers: Modifiers,
pub key: Key,
}Expand description
A key with modifiers, such as Ctrl+Shift+S.
Parsed from and displayed as text so that shortcuts can live in
configuration and in the shortcut attribute of an element.
Fields§
§modifiers: Modifiers§key: KeyImplementations§
Source§impl Shortcut
impl Shortcut
pub const fn new(modifiers: Modifiers, key: Key) -> Self
Sourcepub fn parse(text: &str) -> Result<Self, ShortcutParseError>
pub fn parse(text: &str) -> Result<Self, ShortcutParseError>
Parses Ctrl+S, Cmd+Shift+Z, F5, Escape and the like. Parts are
separated by +, in any order, ignoring case. Ctrl, Control,
Shift, Alt, Option, Cmd, Meta, Super and Win are the
modifiers; a single character or a key name is the key.
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