Expand description
Accelerators describe keyboard shortcuts for menu items.
Accelerator
s are used to define a keyboard shortcut consisting
of an optional combination of modifier keys (provided by Modifiers
) and
one key (Code
).
§Examples
They can be created directly
let accelerator = Accelerator::new(Some(Modifiers::SHIFT), Code::KeyQ);
let accelerator_without_mods = Accelerator::new(None, Code::KeyQ);
or from &str
, note that all modifiers
have to be listed before the non-modifier key, shift+alt+KeyQ
is legal,
whereas shift+q+alt
is not.
let accelerator: Accelerator = "shift+alt+KeyQ".parse().unwrap();
Structs§
- Pressed modifier keys.
Enums§
- Code is the physical position of a key.