pub struct KeyBinding {
pub modifiers: ModifierMask,
pub key: KeyCode,
pub action: ShortcutAction,
pub priority: ShortcutPriority,
pub enabled: bool,
}Expand description
A keyboard shortcut binding.
Fields§
§modifiers: ModifierMaskRequired modifier keys.
key: KeyCodeThe key code.
action: ShortcutActionAction to perform.
priority: ShortcutPriorityPriority for conflict resolution.
enabled: boolWhether this binding is currently enabled.
Implementations§
Source§impl KeyBinding
impl KeyBinding
Sourcepub fn new(
modifiers: ModifierMask,
key: KeyCode,
action: ShortcutAction,
) -> Self
pub fn new( modifiers: ModifierMask, key: KeyCode, action: ShortcutAction, ) -> Self
Create a new key binding.
Sourcepub fn with_priority(self, priority: ShortcutPriority) -> Self
pub fn with_priority(self, priority: ShortcutPriority) -> Self
Create a new key binding with priority.
Sourcepub fn matches(&self, modifiers: ModifierMask, key: KeyCode) -> bool
pub fn matches(&self, modifiers: ModifierMask, key: KeyCode) -> bool
Check if this binding matches the given modifiers and key.
Trait Implementations§
Source§impl Clone for KeyBinding
impl Clone for KeyBinding
Source§fn clone(&self) -> KeyBinding
fn clone(&self) -> KeyBinding
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KeyBinding
impl Debug for KeyBinding
Source§impl PartialEq for KeyBinding
impl PartialEq for KeyBinding
impl Copy for KeyBinding
impl Eq for KeyBinding
impl StructuralPartialEq for KeyBinding
Auto Trait Implementations§
impl Freeze for KeyBinding
impl RefUnwindSafe for KeyBinding
impl Send for KeyBinding
impl Sync for KeyBinding
impl Unpin for KeyBinding
impl UnwindSafe for KeyBinding
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)