#[non_exhaustive]pub enum KeyEventKind {
Press,
Repeat,
Release,
}Expand description
Whether a key event is a press, an auto-repeat, or a release.
Not every backend can distinguish these. Plain terminals only ever emit
Press. Backends with richer input report the full set:
- The winit/software backend emits
Press,Repeat(winit’srepeatflag), andRelease. - The crossterm backend emits the full set only when the terminal supports
the kitty keyboard protocol (kitty,
WezTerm, foot, Ghostty, recent Alacritty); otherwise it degrades toPress-only.
Marked #[non_exhaustive] for consistency with sibling public enums, in case a future source
reports a state finer-grained than this set (e.g. distinguishing an OS-level key-repeat from a
backend-synthesized one).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Trait Implementations§
Source§impl Clone for KeyEventKind
impl Clone for KeyEventKind
Source§fn clone(&self) -> KeyEventKind
fn clone(&self) -> KeyEventKind
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KeyEventKind
impl Debug for KeyEventKind
Source§impl Default for KeyEventKind
impl Default for KeyEventKind
Source§fn default() -> KeyEventKind
fn default() -> KeyEventKind
Returns the “default value” for a type. Read more
Source§impl Hash for KeyEventKind
impl Hash for KeyEventKind
Source§impl PartialEq for KeyEventKind
impl PartialEq for KeyEventKind
Source§fn eq(&self, other: &KeyEventKind) -> bool
fn eq(&self, other: &KeyEventKind) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for KeyEventKind
impl Eq for KeyEventKind
impl StructuralPartialEq for KeyEventKind
Auto Trait Implementations§
impl Freeze for KeyEventKind
impl RefUnwindSafe for KeyEventKind
impl Send for KeyEventKind
impl Sync for KeyEventKind
impl Unpin for KeyEventKind
impl UnsafeUnpin for KeyEventKind
impl UnwindSafe for KeyEventKind
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<C> WithAlpha for Cwhere
C: Copy,
impl<C> WithAlpha for Cwhere
C: Copy,
§fn with_alpha_first<A>(self, alpha: A) -> AlphaFirst<A, Self>
fn with_alpha_first<A>(self, alpha: A) -> AlphaFirst<A, Self>
Wraps
self with alpha, storing alpha before the color in memory
(see [AlphaFirst]).§fn with_alpha_last<A>(self, alpha: A) -> AlphaLast<A, Self>
fn with_alpha_last<A>(self, alpha: A) -> AlphaLast<A, Self>
Wraps
self with alpha, storing alpha after the color in memory
(see [AlphaLast]).