Struct wezterm_input_types::KeyEvent
source · pub struct KeyEvent {
pub key: KeyCode,
pub modifiers: Modifiers,
pub leds: KeyboardLedStatus,
pub repeat_count: u16,
pub key_is_down: bool,
pub raw: Option<RawKeyEvent>,
pub win32_uni_char: Option<char>,
}
Fields§
§key: KeyCode
Which key was pressed. This is the potentially processed/composed version of the input.
modifiers: Modifiers
Which modifiers are down
leds: KeyboardLedStatus
§repeat_count: u16
How many times this key repeats
key_is_down: bool
If true, this is a key down rather than a key up event
raw: Option<RawKeyEvent>
If triggered from a raw key event, here it is.
win32_uni_char: Option<char>
Implementations§
source§impl KeyEvent
impl KeyEvent
sourcepub fn normalize_shift(self) -> Self
pub fn normalize_shift(self) -> Self
if SHIFT is held and we have KeyCode::Char(‘c’) we want to normalize that keycode to KeyCode::Char(‘C’); that is what this function does.
sourcepub fn resurface_positional_modifier_key(self) -> Self
pub fn resurface_positional_modifier_key(self) -> Self
If the key code is a modifier key (Control, Alt, Shift), check the underlying raw event to see if we had a positional version of that key. If so, switch to the positional version.
sourcepub fn normalize_ctrl(self) -> Self
pub fn normalize_ctrl(self) -> Self
If CTRL is held down and we have KeyCode::Char(_) with the ASCII control value encoded, decode it back to the ASCII alpha keycode instead.
sourcepub fn encode_win32_input_mode(&self) -> Option<String>
pub fn encode_win32_input_mode(&self) -> Option<String>
pub fn encode_kitty(&self, flags: KittyKeyboardFlags) -> String
Trait Implementations§
source§impl PartialEq for KeyEvent
impl PartialEq for KeyEvent
impl Eq for KeyEvent
impl StructuralEq for KeyEvent
impl StructuralPartialEq for KeyEvent
Auto Trait Implementations§
impl RefUnwindSafe for KeyEvent
impl Send for KeyEvent
impl Sync for KeyEvent
impl Unpin for KeyEvent
impl UnwindSafe for KeyEvent
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