#[non_exhaustive]pub struct KeyEvent {
pub state: KeyState,
pub key: Key,
pub code: Code,
pub location: Location,
pub mods: Modifiers,
pub repeat: bool,
pub is_composing: bool,
}
Expand description
Information about a keyboard event.
Note that this type is similar to KeyboardEvent
in keyboard-types,
but has a few small differences for convenience.
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.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.
mods: 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 PartialEq<KeyEvent> for KeyEvent
impl PartialEq<KeyEvent> for KeyEvent
impl Eq for KeyEvent
impl StructuralEq for KeyEvent
impl StructuralPartialEq for KeyEvent
Auto Trait Implementations§
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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> RoundFrom<T> for T
impl<T> RoundFrom<T> for T
§fn round_from(x: T) -> T
fn round_from(x: T) -> T
Performs the conversion.
§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere U: RoundFrom<T>,
§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.