Struct druid_shell::KeyEvent [−][src]
#[non_exhaustive]pub struct KeyEvent {
pub state: KeyState,
pub key: KbKey,
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. It is missing the state
field because that is already implicit in the event.
Fields (Non-exhaustive)
This struct is marked as non-exhaustive
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: KbKey
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
Auto Trait Implementations
impl RefUnwindSafe for KeyEvent
impl UnwindSafe for KeyEvent
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn round_from(x: T) -> T
pub fn round_from(x: T) -> T
Performs the conversion.
pub fn round_into(self) -> U
pub fn round_into(self) -> U
Performs the conversion.
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more