pub struct KeyEvent {
pub code: KeyCode,
pub modifiers: KeyModifiers,
}Expand description
SDK-facing key event DTO.
KeyEvent is intentionally inert: constructing one does not arm a
detector, push a frame, or open a daemon connection. SDK consumers
build these from their own keyboard source (or via the optional
crossterm feature) and feed them into helpers like
DetachDetector::feed.
Fields§
§code: KeyCodeLogical key code.
modifiers: KeyModifiersActive modifier flags when the key was reported.
Implementations§
Trait Implementations§
impl Copy for KeyEvent
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
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 UnsafeUnpin 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