Struct keyboard_types::KeyboardEvent
source · 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 copy 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<'de> Deserialize<'de> for KeyboardEvent
impl<'de> Deserialize<'de> for KeyboardEvent
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
source§impl From<KeyboardEvent> for Event
impl From<KeyboardEvent> for Event
source§fn from(v: KeyboardEvent) -> Event
fn from(v: KeyboardEvent) -> Event
Converts to this type from the input type.
source§impl Hash for KeyboardEvent
impl Hash for KeyboardEvent
source§impl PartialEq<KeyboardEvent> for KeyboardEvent
impl PartialEq<KeyboardEvent> for KeyboardEvent
source§fn eq(&self, other: &KeyboardEvent) -> bool
fn eq(&self, other: &KeyboardEvent) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for KeyboardEvent
impl Serialize for KeyboardEvent
impl Eq for KeyboardEvent
impl StructuralEq for KeyboardEvent
impl StructuralPartialEq for KeyboardEvent
Auto Trait Implementations§
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