Enum crossterm::event::ModifierKeyCode
source · pub enum ModifierKeyCode {
Show 14 variants
LeftShift,
LeftControl,
LeftAlt,
LeftSuper,
LeftHyper,
LeftMeta,
RightShift,
RightControl,
RightAlt,
RightSuper,
RightHyper,
RightMeta,
IsoLevel3Shift,
IsoLevel5Shift,
}
Expand description
Represents a modifier key (as part of KeyCode::Modifier
).
Variants§
LeftShift
Left Shift key.
LeftControl
Left Control key. (Control on macOS, Ctrl on other platforms)
LeftAlt
Left Alt key. (Option on macOS, Alt on other platforms)
LeftSuper
Left Super key. (Command on macOS, Windows on Windows, Super on other platforms)
LeftHyper
Left Hyper key.
LeftMeta
Left Meta key.
RightShift
Right Shift key.
RightControl
Right Control key. (Control on macOS, Ctrl on other platforms)
RightAlt
Right Alt key. (Option on macOS, Alt on other platforms)
RightSuper
Right Super key. (Command on macOS, Windows on Windows, Super on other platforms)
RightHyper
Right Hyper key.
RightMeta
Right Meta key.
IsoLevel3Shift
Iso Level3 Shift key.
IsoLevel5Shift
Iso Level5 Shift key.
Trait Implementations§
source§impl Clone for ModifierKeyCode
impl Clone for ModifierKeyCode
source§fn clone(&self) -> ModifierKeyCode
fn clone(&self) -> ModifierKeyCode
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ModifierKeyCode
impl Debug for ModifierKeyCode
source§impl Display for ModifierKeyCode
impl Display for ModifierKeyCode
source§fn fmt(&self, f: &mut Formatter<'_>) -> Result
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Formats the modifier key using the given formatter.
Platform-specific Notes
On macOS, the control, alt, and super keys are displayed as “Control”, “Option”, and “Command” respectively. See https://support.apple.com/guide/applestyleguide/welcome/1.0/web.
On Windows, the super key is displayed as “Windows” and the control key is displayed as “Ctrl”. See https://learn.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/term-collections/keys-keyboard-shortcuts.
On other platforms, the super key is referred to as “Super”.
source§impl Hash for ModifierKeyCode
impl Hash for ModifierKeyCode
source§impl PartialEq<ModifierKeyCode> for ModifierKeyCode
impl PartialEq<ModifierKeyCode> for ModifierKeyCode
source§fn eq(&self, other: &ModifierKeyCode) -> bool
fn eq(&self, other: &ModifierKeyCode) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<ModifierKeyCode> for ModifierKeyCode
impl PartialOrd<ModifierKeyCode> for ModifierKeyCode
source§fn partial_cmp(&self, other: &ModifierKeyCode) -> Option<Ordering>
fn partial_cmp(&self, other: &ModifierKeyCode) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more