pub struct Shortcut {
pub modifiers: ModifierList,
pub key: Key,
}
Expand description
A keyboard shortcut consisting of zero or more modifier keys and a non-modifier key
Examples:
Create from keys:
let shortcut = Shortcut::new(&[Modifier::Meta], Key::KeyN);
Parse from string:
let shortcut: Shortcut = "<Meta>-KeyN".parse()?;
Fields§
§modifiers: ModifierList
§key: Key
Implementations§
source§impl Shortcut
impl Shortcut
pub fn is_triggered(&self, active_keys: &HashSet<Key, RandomState>) -> bool
Trait Implementations§
source§impl PartialEq<Shortcut> for Shortcut
impl PartialEq<Shortcut> for Shortcut
impl Eq for Shortcut
impl StructuralEq for Shortcut
impl StructuralPartialEq for Shortcut
Auto Trait Implementations§
impl RefUnwindSafe for Shortcut
impl Send for Shortcut
impl Sync for Shortcut
impl Unpin 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