pub struct KeyEvent {
pub source: EventSource,
pub down: bool,
pub repeat: bool,
pub code: String,
pub alt_key: bool,
pub ctrl_key: bool,
pub meta_key: bool,
pub shift_key: bool,
}
Expand description
A keyboard event.
Fields§
§source: EventSource
The client identifier.
down: bool
Whether the key was pressed.
repeat: bool
Whether the event is a repeat event.
code: String
The key pressed, see the docs on JS’s KeyboardEvent.code
for details.
alt_key: bool
Whether the alt key is held.
ctrl_key: bool
Whether the ctrl key is held.
meta_key: bool
Whether the meta key is held.
shift_key: bool
Whether the shiftKey key is held.
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
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