pub enum KeyboardEvent {
Down {
key: Key,
physical: Option<PhysicalKey>,
modifiers: Modifiers,
repeat: bool,
},
Up {
key: Key,
physical: Option<PhysicalKey>,
modifiers: Modifiers,
},
CharInput {
text: String,
},
}Expand description
A keyboard event carrying both logical and physical key information.
Variants§
Down
A key was pressed (or auto-repeated; see repeat).
Fields
§
physical: Option<PhysicalKey>The physical key location, if known.
Up
A key was released.
Fields
§
physical: Option<PhysicalKey>The physical key location, if known.
CharInput
Committed text input (post-IME). Distinct from Down so a text field can
ignore navigation keys while still receiving typed characters.
Implementations§
Trait Implementations§
Source§impl Clone for KeyboardEvent
impl Clone for KeyboardEvent
Source§fn clone(&self) -> KeyboardEvent
fn clone(&self) -> KeyboardEvent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KeyboardEvent
impl Debug for KeyboardEvent
Source§impl PartialEq for KeyboardEvent
impl PartialEq for KeyboardEvent
Source§fn eq(&self, other: &KeyboardEvent) -> bool
fn eq(&self, other: &KeyboardEvent) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for KeyboardEvent
Auto Trait Implementations§
impl Freeze for KeyboardEvent
impl RefUnwindSafe for KeyboardEvent
impl Send for KeyboardEvent
impl Sync for KeyboardEvent
impl Unpin for KeyboardEvent
impl UnsafeUnpin for KeyboardEvent
impl UnwindSafe for KeyboardEvent
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