[][src]Enum sixtyfps_corelib::input::KeyEvent

#[repr(C)]pub enum KeyEvent {
    KeyPressed {
        code: KeyCode,
        modifiers: KeyboardModifiers,
    },
    KeyReleased {
        code: KeyCode,
        modifiers: KeyboardModifiers,
    },
    CharacterInput {
        unicode_scalar: u32,
        modifiers: KeyboardModifiers,
    },
}

Represents a key event sent by the windowing system.

Variants

KeyPressed

A key on a keyboard was pressed.

Fields of KeyPressed

code: KeyCode

The key code of the pressed key.

modifiers: KeyboardModifiers

The keyboard modifiers active at the time of the key press event.

KeyReleased

A key on a keyboard was released.

Fields of KeyReleased

code: KeyCode

The key code of the released key.

modifiers: KeyboardModifiers

The keyboard modifiers active at the time of the key release event.

CharacterInput

A key on a keyboard was released that results in a character that's suitable for text input.

Fields of CharacterInput

unicode_scalar: u32

The u32 is a unicode scalar value that is safe to convert to char.

modifiers: KeyboardModifiers

The keyboard modifiers active at the time of the char input event.

Trait Implementations

impl Clone for KeyEvent[src]

impl Debug for KeyEvent[src]

impl PartialEq<KeyEvent> for KeyEvent[src]

impl StructuralPartialEq for KeyEvent[src]

impl<'_> TryFrom<(&'_ KeyboardInput, KeyboardModifiers)> for KeyEvent[src]

type Error = ()

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[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> 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.