pub struct Shortcut {
pub key: String,
pub primary: bool,
pub shift: bool,
pub alt: bool,
pub control: bool,
}Expand description
A keyboard shortcut for a menu item. primary is the platform’s command modifier — ⌘ on Apple,
Ctrl on GTK/Qt/XAML — so one declaration reads correctly everywhere. key is a single character
("s", ".") or a named key ("Return", "Delete", "Left", "F1").
Fields§
§key: String§primary: bool⌘ (Apple) / Ctrl (elsewhere). The conventional command modifier.
shift: bool§alt: bool⌥ / Alt.
control: boolLiteral Control (⌃ on Apple). Rare — prefer primary for the command modifier.
Implementations§
Trait Implementations§
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