[][src]Struct druid::KeyEvent

#[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,
}

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)

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

impl Clone for KeyEvent[src]

impl Debug for KeyEvent[src]

impl Default for KeyEvent[src]

impl Eq for KeyEvent[src]

impl Hash for KeyEvent[src]

impl PartialEq<KeyEvent> for KeyEvent[src]

impl StructuralEq for KeyEvent[src]

impl StructuralPartialEq for KeyEvent[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> AnyEq for T where
    T: PartialEq<T> + Any
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> RoundFrom<T> for T

impl<T, U> RoundInto<U> for T where
    U: RoundFrom<T>, 

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.