pub struct ShortcutGroup { /* private fields */ }Expand description
A group of shortcuts where any one can trigger the action.
Useful for supporting multiple shortcuts for the same action, like both “Cmd+Z” and “Ctrl+Z” for undo on different platforms.
Implementations§
Source§impl ShortcutGroup
impl ShortcutGroup
Sourcepub fn with(self, shortcut: impl Into<DynamicShortcut>) -> Self
pub fn with(self, shortcut: impl Into<DynamicShortcut>) -> Self
Add a shortcut to the group.
Sourcepub fn add(&mut self, shortcut: impl Into<DynamicShortcut>)
pub fn add(&mut self, shortcut: impl Into<DynamicShortcut>)
Add a shortcut to the group.
Trait Implementations§
Source§impl Clone for ShortcutGroup
impl Clone for ShortcutGroup
Source§fn clone(&self) -> ShortcutGroup
fn clone(&self) -> ShortcutGroup
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ShortcutGroup
impl Debug for ShortcutGroup
Source§impl Default for ShortcutGroup
impl Default for ShortcutGroup
Source§fn default() -> ShortcutGroup
fn default() -> ShortcutGroup
Returns the “default value” for a type. Read more
Source§impl InputBinding for ShortcutGroup
impl InputBinding for ShortcutGroup
Source§fn matches(&self, ctx: &Context) -> bool
fn matches(&self, ctx: &Context) -> bool
Check if this binding was triggered (does not consume the input).
Source§fn consume(&self, ctx: &Context) -> bool
fn consume(&self, ctx: &Context) -> bool
Consume the input and return whether it was triggered. Read more
Source§fn as_keyboard_shortcut(&self) -> Option<KeyboardShortcut>
fn as_keyboard_shortcut(&self) -> Option<KeyboardShortcut>
Convert to KeyboardShortcut if possible.
Auto Trait Implementations§
impl Freeze for ShortcutGroup
impl RefUnwindSafe for ShortcutGroup
impl Send for ShortcutGroup
impl Sync for ShortcutGroup
impl Unpin for ShortcutGroup
impl UnsafeUnpin for ShortcutGroup
impl UnwindSafe for ShortcutGroup
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