pub struct ShortcutMap {
pub bindings: Vec<(KeyboardShortcut, KeyboardAction)>,
}Expand description
Editable bindings shared by input dispatch, menus and shortcut help.
Remove a binding to disable it, or replace its key or action to rebind it. The first binding wins if several actions use the same key combination.
Fields§
§bindings: Vec<(KeyboardShortcut, KeyboardAction)>Key combinations and their actions, in precedence order.
Implementations§
Source§impl ShortcutMap
impl ShortcutMap
Sourcepub fn shortcut(&self, action: KeyboardAction) -> Option<KeyboardShortcut>
pub fn shortcut(&self, action: KeyboardAction) -> Option<KeyboardShortcut>
The first binding for an action, for a platform-formatted menu hint.
Sourcepub fn by_category(&self) -> Vec<(&'static str, Vec<KeyboardAction>)>
pub fn by_category(&self) -> Vec<(&'static str, Vec<KeyboardAction>)>
Bound actions grouped for help, including bindings added by the host.
Trait Implementations§
Source§impl Clone for ShortcutMap
impl Clone for ShortcutMap
Source§fn clone(&self) -> ShortcutMap
fn clone(&self) -> ShortcutMap
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ShortcutMap
impl Debug for ShortcutMap
Auto Trait Implementations§
impl Freeze for ShortcutMap
impl RefUnwindSafe for ShortcutMap
impl Send for ShortcutMap
impl Sync for ShortcutMap
impl Unpin for ShortcutMap
impl UnsafeUnpin for ShortcutMap
impl UnwindSafe for ShortcutMap
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more