Enum wezterm_input_types::KeyCode
source · pub enum KeyCode {
Show 75 variants
Char(char),
Composed(String),
RawCode(u32),
Physical(PhysKeyCode),
Hyper,
Super,
Meta,
Cancel,
Clear,
Shift,
LeftShift,
RightShift,
Control,
LeftControl,
RightControl,
Alt,
LeftAlt,
RightAlt,
Pause,
CapsLock,
VoidSymbol,
PageUp,
PageDown,
End,
Home,
LeftArrow,
RightArrow,
UpArrow,
DownArrow,
Select,
Print,
Execute,
PrintScreen,
Insert,
Help,
LeftWindows,
RightWindows,
Applications,
Sleep,
Numpad(u8),
Multiply,
Add,
Separator,
Subtract,
Decimal,
Divide,
Function(u8),
NumLock,
ScrollLock,
Copy,
Cut,
Paste,
BrowserBack,
BrowserForward,
BrowserRefresh,
BrowserStop,
BrowserSearch,
BrowserFavorites,
BrowserHome,
VolumeMute,
VolumeDown,
VolumeUp,
MediaNextTrack,
MediaPrevTrack,
MediaStop,
MediaPlayPause,
ApplicationLeftArrow,
ApplicationRightArrow,
ApplicationUpArrow,
ApplicationDownArrow,
KeyPadHome,
KeyPadEnd,
KeyPadPageUp,
KeyPadPageDown,
KeyPadBegin,
}
Expand description
Which key is pressed. Not all of these are probable to appear on most systems. A lot of this list is @wez trawling docs and making an entry for things that might be possible in this first pass.
Variants§
Char(char)
The decoded unicode character
Composed(String)
RawCode(u32)
Physical(PhysKeyCode)
Hyper
Super
Meta
Cancel
Ctrl-break on windows
Clear
Shift
LeftShift
RightShift
Control
LeftControl
RightControl
Alt
LeftAlt
RightAlt
Pause
CapsLock
VoidSymbol
PageUp
PageDown
End
Home
LeftArrow
RightArrow
UpArrow
DownArrow
Select
Execute
PrintScreen
Insert
Help
LeftWindows
RightWindows
Applications
Sleep
Numpad(u8)
Numeric keypad digits 0-9
Multiply
Add
Separator
Subtract
Decimal
Divide
Function(u8)
F1-F24 are possible
NumLock
ScrollLock
Copy
Cut
Paste
BrowserBack
BrowserForward
BrowserRefresh
BrowserStop
BrowserSearch
BrowserFavorites
BrowserHome
VolumeMute
VolumeDown
VolumeUp
MediaNextTrack
MediaPrevTrack
MediaStop
MediaPlayPause
ApplicationLeftArrow
ApplicationRightArrow
ApplicationUpArrow
ApplicationDownArrow
KeyPadHome
KeyPadEnd
KeyPadPageUp
KeyPadPageDown
KeyPadBegin
Implementations§
source§impl KeyCode
impl KeyCode
sourcepub fn is_modifier(&self) -> bool
pub fn is_modifier(&self) -> bool
Return true if the key represents a modifier key.
pub fn normalize_shift(&self, modifiers: Modifiers) -> (KeyCode, Modifiers)
pub fn composed(s: &str) -> Self
sourcepub fn to_phys(&self) -> Option<PhysKeyCode>
pub fn to_phys(&self) -> Option<PhysKeyCode>
Convert to a PhysKeyCode. Note that by the nature of PhysKeyCode being defined in terms of a US ANSI standard layout, essentially “latinizes” the keycode, so the results may not make as much sense for non-latin keyboards. It also loses the shifted state of alphabetical characters.
Trait Implementations§
source§impl<'de> Deserialize<'de> for KeyCode
impl<'de> Deserialize<'de> for KeyCode
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl FromDynamic for KeyCode
impl FromDynamic for KeyCode
fn from_dynamic( value: &Value, options: FromDynamicOptions ) -> Result<Self, Error>
source§impl Ord for KeyCode
impl Ord for KeyCode
source§impl PartialEq for KeyCode
impl PartialEq for KeyCode
source§impl PartialOrd for KeyCode
impl PartialOrd for KeyCode
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for KeyCode
impl StructuralEq for KeyCode
impl StructuralPartialEq for KeyCode
Auto Trait Implementations§
impl RefUnwindSafe for KeyCode
impl Send for KeyCode
impl Sync for KeyCode
impl Unpin for KeyCode
impl UnwindSafe for KeyCode
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