pub struct KeyEvent {
pub key: Key,
pub mods: Modifiers,
pub action: KeyAction,
pub shifted_key: Option<char>,
pub base_key: Option<char>,
pub text: Option<char>,
}Expand description
A key event: a key, the modifiers held with it, its press/repeat/release type
(defaults to Press), and consumer-supplied extras the kitty protocol’s
alternate-keys / associated-text flags report (all None for legacy).
No #[non_exhaustive] (#844). 16 out-of-crate literal sites, and a Default already
exists, so KeyEvent { key, ..Default::default() } absorbs a new field at the caller’s choice
rather than by imposition — the same reading as crate::Frame.
Fields§
§key: Key§mods: Modifiers§action: KeyAction§shifted_key: Option<char>Kitty alternate-keys (bit 2): the codepoint Shift would produce, if it
differs from key.
base_key: Option<char>Kitty alternate-keys (bit 2): the codepoint at this key’s position on the
base (standard) layout, if it differs from key.
text: Option<char>Kitty associated-text (bit 4): the text the key actually produced (composed input / dead keys).