Module hotkey

Source
Expand description

HotKeys describe keyboard global shortcuts.

HotKeys 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 hotkey = HotKey::new(Some(Modifiers::SHIFT), Code::KeyQ);
let hotkey_without_mods = HotKey::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 hotkey: HotKey = "shift+alt+KeyQ".parse().unwrap();

Structs§

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

Enums§

Code
Code is the physical position of a key.
HotKeyParseError

Constants§

CMD_OR_CTRL