pub struct Key {Show 15 fields
pub name: String,
pub ctrl: bool,
pub meta: bool,
pub shift: bool,
pub sequence: String,
pub raw: Option<String>,
pub code: Option<String>,
pub super_key: bool,
pub hyper: bool,
pub caps_lock: bool,
pub num_lock: bool,
pub event_type: Option<EventType>,
pub is_kitty_protocol: bool,
pub text: Option<String>,
pub is_printable: Option<bool>,
}Expand description
A decoded key event, mirroring ink’s Key object (including kitty fields).
Fields§
§name: StringResolved key name (e.g. "up", "a", "return", "number"). Empty
when the sequence is unmapped.
ctrl: bool§meta: bool§shift: bool§sequence: StringThe original sequence (decoded to text). Mirrors key.sequence.
raw: Option<String>The raw sequence. None mirrors upstream’s raw: undefined cases.
code: Option<String>Reassembled escape code for legacy fn-key sequences (key.code).
super_key: bool§hyper: bool§caps_lock: bool§num_lock: bool§event_type: Option<EventType>Only set by the kitty protocol parser.
is_kitty_protocol: booltrue only for kitty-protocol keypresses.
text: Option<String>Associated text input (kitty text-as-codepoints, or the default
character for printable kitty keys).
is_printable: Option<bool>Whether this key represents printable text input. Only set by the kitty
protocol parser (None for legacy keys).
Trait Implementations§
impl Eq for Key
impl StructuralPartialEq for Key
Auto Trait Implementations§
impl Freeze for Key
impl RefUnwindSafe for Key
impl Send for Key
impl Sync for Key
impl Unpin for Key
impl UnsafeUnpin for Key
impl UnwindSafe for Key
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more