Module accelerator

Source
Expand description

Accelerators describe keyboard shortcuts for menu items.

Accelerators 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§

Accelerator
A keyboard shortcut that consists of an optional combination of modifier keys (provided by Modifiers and one key (Code).
Modifiers
Pressed modifier keys.

Enums§

AcceleratorParseError
Code
Code is the physical position of a key.

Constants§

CMD_OR_CTRL