[][src]Struct input_device::event::KeyboardInput

pub struct KeyboardInput {
    pub scancode: ScanCode,
    pub state: ElementState,
    pub virtual_keycode: Option<VirtualKeyCode>,
}

Describes a keyboard input event.

Fields

scancode: ScanCode

Identifies the physical key pressed

This should not change if the user adjusts the host's keyboard map. Use when the physical location of the key is more important than the key's host GUI semantics, such as for movement controls in a first-person game.

state: ElementState

Identifies the key is pressed, released or repeated.

virtual_keycode: Option<VirtualKeyCode>

Identifies the semantic meaning of the key

Use when the semantics of the key are more important than the physical location of the key, such as when implementing appropriate behavior for "page up."

Implementations

impl KeyboardInput[src]

pub fn is_key_pressed(&self, key_code: VirtualKeyCode) -> bool[src]

pub fn is_key_released(&self, key_code: VirtualKeyCode) -> bool[src]

pub fn is_key_repeated(&self, key_code: VirtualKeyCode) -> bool[src]

pub fn is_key_triggered(&self, key_code: VirtualKeyCode) -> bool[src]

Trait Implementations

impl Clone for KeyboardInput[src]

impl Copy for KeyboardInput[src]

impl Debug for KeyboardInput[src]

impl Default for KeyboardInput[src]

impl Eq for KeyboardInput[src]

impl Hash for KeyboardInput[src]

impl PartialEq<KeyboardInput> for KeyboardInput[src]

impl StructuralEq for KeyboardInput[src]

impl StructuralPartialEq for KeyboardInput[src]

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.