#[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: KeyStateWhether the key is pressed or released.
key: KeyLogical key value.
code: CodePhysical key position.
location: LocationLocation for keys with multiple instances on common keyboards.
mods: ModifiersFlags for pressed modifier keys.
repeat: boolTrue if the key is currently auto-repeated.
is_composing: boolEvents with this flag should be ignored in a text editor and instead composition events should be used.
Trait Implementations§
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§
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§impl<T> Pointable for T
impl<T> Pointable for T
§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.