Expand description

Accelerators describe keyboard shortcuts defined by the application.

Accelerators are used to define a keyboard shortcut consisting of an optional combination of modifier keys (provided by SysMods, RawMods or ModifiersState) and one key (KeyCode).

Examples

They can be created directly

let accelerator = Accelerator::new(SysMods::Shift, KeyCode::KeyQ);
let accelerator_with_raw_mods = Accelerator::new(RawMods::Shift, KeyCode::KeyQ);
let accelerator_without_mods = Accelerator::new(None, KeyCode::KeyQ);

or from &str, note that all modifiers have to be listed before the non-modifier key, shift+alt+q is legal, whereas shift+q+alt is not.

let accelerator: Accelerator = "shift+alt+q".parse().unwrap();

Structs

Base Accelerator functions.
Identifier of an Accelerator.

Enums

Represents the active modifier keys.
Represents the platform-agnostic keyboard modifiers, for command handling.