pub struct KeyboardEvent {
pub state: KeyState,
pub key: Key,
pub code: Code,
pub location: Location,
pub modifiers: Modifiers,
pub repeat: bool,
pub is_composing: bool,
}
Expand description
Keyboard events are issued for all pressed and released keys.
Fields§
§state: KeyState
Whether the key is pressed or released.
key: Key
Logical key value.
code: Code
Physical key position.
location: Location
Location for keys with multiple instances on common keyboards.
modifiers: Modifiers
Flags for pressed modifier keys.
repeat: bool
True if the key is currently auto-repeated.
is_composing: bool
Events with this flag should be ignored in a text editor and instead composition events should be used.
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 · 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 Default for KeyboardEvent
impl Default for KeyboardEvent
Source§fn default() -> KeyboardEvent
fn default() -> KeyboardEvent
Returns the “default value” for a type. Read more
Source§impl Hash for KeyboardEvent
impl Hash for KeyboardEvent
Source§impl Ord for KeyboardEvent
impl Ord for KeyboardEvent
Source§fn cmp(&self, other: &KeyboardEvent) -> Ordering
fn cmp(&self, other: &KeyboardEvent) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for KeyboardEvent
impl PartialEq for KeyboardEvent
Source§impl PartialOrd for KeyboardEvent
impl PartialOrd for KeyboardEvent
impl Eq for KeyboardEvent
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 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