pub struct KeyEvent {
pub code: KeyCode,
pub modifier: KeyModifier,
}Expand description
A keyboard event
Fields§
§code: KeyCodeThe keycode represented by the key pressed.
modifier: KeyModifierKey modifiers (e.g. ctrl).
Note that key modifiers are modifiers. They cannot exist on their own.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for KeyEvent
impl<'de> Deserialize<'de> for KeyEvent
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 From<KeyEvent> for KeyEventBetterSerde
impl From<KeyEvent> for KeyEventBetterSerde
Source§impl From<KeyEventBetterSerde> for KeyEvent
impl From<KeyEventBetterSerde> for KeyEvent
Source§fn from(value: KeyEventBetterSerde) -> Self
fn from(value: KeyEventBetterSerde) -> Self
Converts to this type from the input type.
impl Copy for KeyEvent
impl Eq for KeyEvent
impl StructuralPartialEq for KeyEvent
Auto Trait Implementations§
impl Freeze for KeyEvent
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