[][src]Struct druid::KeyEvent

pub struct KeyEvent {
    pub key_code: KeyCode,
    pub is_repeat: bool,
    pub mods: KeyModifiers,
    // some fields omitted
}

A keyboard event, generated on every key press and key release.

Fields

key_code: KeyCode

The platform independent keycode.

is_repeat: bool

Whether or not this event is a repeat (the key was held down)

mods: KeyModifiers

The modifiers for this event.

Methods

impl KeyEvent[src]

pub fn text(&self) -> Option<&str>[src]

The resolved input text for this event. This takes into account modifiers, e.g. the chars on macOS for opt+s is 'ß'.

pub fn unmod_text(&self) -> Option<&str>[src]

The unmodified input text for this event. On macOS, for opt+s, this is 's'.

Trait Implementations

impl Copy for KeyEvent[src]

impl Debug for KeyEvent[src]

impl Clone for KeyEvent[src]

Auto Trait Implementations

Blanket Implementations

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

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

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.

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

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

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

impl<T> RoundFrom<T> for T

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