pub enum KeyInput {
Char(char),
Enter,
Backspace,
Delete,
Tab,
Escape,
Arrow(Arrow),
Modifier(Modifier),
}Expand description
The semantic meaning of a key press after applying modifiers.
This represents what a key produces, not which key was physically
pressed. For example, pressing W while holding Shift produces
KeyInput::Char('W'), and pressing ; while holding Fn produces
KeyInput::Arrow(Arrow::Up).
§Some examples
| Pressed keys | Resulting KeyInput |
|---|---|
; | Char(';') |
Shift + ; | Char(':') |
Fn + ; | Arrow(Arrow::Up) |
| Space | Char(' ') |
Fn + ` | Escape |
| Fn + Backspace | Delete |
If a key has no special meaning for the currently pressed modifier, it just returns its default.
Fn + w => Char('w')
If a key has both a Shift and Fn layer, the Fn layer is always prioritized when both are pressed.
Fn + Shift + ; => Arrow(Arrow::Up)
Variants§
Char(char)
A printable character after applying shift/Fn modifiers.
Enter
Enter / Return key.
Backspace
Backspace key.
Delete
Delete (Fn + Backspace).
Tab
Tab key.
Escape
Escape (Fn + Backtick).
Arrow(Arrow)
An arrow key (Fn + ; , . /).
Modifier(Modifier)
A modifier key was pressed (Shift, Fn, Ctrl, Opt, Alt).