#[non_exhaustive]pub struct KeyEvent<'a> {
pub key: Key<'a>,
pub text: Option<&'a str>,
pub pressed: bool,
pub repeat: bool,
pub modifiers: Modifiers,
}Expand description
A key event.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.key: Key<'a>The key, after the keyboard layout.
text: Option<&'a str>The text the key types, if any: what an editor inserts.
pressed: boolDown (true) or up.
repeat: boolDown again because the key is held.
modifiers: ModifiersModifier keys held.
Implementations§
Trait Implementations§
impl<'a> Copy for KeyEvent<'a>
impl<'a> StructuralPartialEq for KeyEvent<'a>
Auto Trait Implementations§
impl<'a> Freeze for KeyEvent<'a>
impl<'a> RefUnwindSafe for KeyEvent<'a>
impl<'a> Send for KeyEvent<'a>
impl<'a> Sync for KeyEvent<'a>
impl<'a> Unpin for KeyEvent<'a>
impl<'a> UnsafeUnpin for KeyEvent<'a>
impl<'a> UnwindSafe for KeyEvent<'a>
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