[][src]Struct winconsole::input::KeyEvent

pub struct KeyEvent {
    pub character: char,
    pub key_code: KeyCode,
    pub modifiers: ControlKeyState,
    pub pressed: bool,
    pub repeat_count: u16,
    pub scan_code: u16,
}

Represents an input event which occurred on the keyboard.

Fields

character: char

The character associated with the pressed key.

key_code: KeyCode

The KeyCode of the key which the event occurred on.

modifiers: ControlKeyState

A ControlKeyState object describing the state of control keys.

pressed: bool

Is the key pressed?

repeat_count: u16

The amount of times the event was repeated in the input buffer.

scan_code: u16

The scan code of the key.

Methods

impl KeyEvent[src]

pub fn new() -> KeyEvent[src]

Returns an empty KeyEvent.

Trait Implementations

impl PartialEq<KeyEvent> for KeyEvent[src]

impl Clone for KeyEvent[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Into<InputEvent> for KeyEvent[src]

impl Copy for KeyEvent[src]

impl Debug for KeyEvent[src]

impl Serialize for KeyEvent[src]

impl<'de> Deserialize<'de> for KeyEvent[src]

Auto Trait Implementations

impl Send for KeyEvent

impl Sync for KeyEvent

Blanket Implementations

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> Into<U> for T where
    U: From<T>, 
[src]

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> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]