#[non_exhaustive]pub enum ModifierKey {
Shift,
Control,
Alt,
Super,
}Expand description
A modifier key pressed as a standalone key event, independent of the KeyModifiers flags
carried on non-modifier key events.
This is flat (no per-side variants) because side is conveyed separately: pair this with the
surrounding KeyEvent’s KeyLocation::Left/KeyLocation::Right rather than duplicating
left/right into ModifierKey itself.
Reporting a bare modifier press as a KeyCode::Modifier event is backend-dependent: the
crossterm backend requires the terminal to support the kitty keyboard protocol with the
REPORT_ALL_KEYS_AS_ESCAPE_CODES enhancement flag enabled; plain terminals never report these.
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 ModifierKey
impl Clone for ModifierKey
Source§fn clone(&self) -> ModifierKey
fn clone(&self) -> ModifierKey
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 ModifierKey
impl Debug for ModifierKey
Source§impl Hash for ModifierKey
impl Hash for ModifierKey
Source§impl PartialEq for ModifierKey
impl PartialEq for ModifierKey
Source§fn eq(&self, other: &ModifierKey) -> bool
fn eq(&self, other: &ModifierKey) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for ModifierKey
impl Eq for ModifierKey
impl StructuralPartialEq for ModifierKey
Auto Trait Implementations§
impl Freeze for ModifierKey
impl RefUnwindSafe for ModifierKey
impl Send for ModifierKey
impl Sync for ModifierKey
impl Unpin for ModifierKey
impl UnsafeUnpin for ModifierKey
impl UnwindSafe for ModifierKey
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]).