[][src]Struct orbtk_api::application::KeyboardState

pub struct KeyboardState { /* fields omitted */ }

Contains the state information for the keyboard.

This currently tracks which keys are currently pressed.

The key state is stored in a lazy-loaded HashMap.

There are several convenience methods to check common modifiers (ctrl, shift, alt, etc). This is useful if you don't care which shift key is down.

Implementations

impl KeyboardState[src]

pub fn set_key_state(&mut self, key: Key, pressed: bool)[src]

Sets whether or not the given key is currently pressed

pub fn is_key_down(&self, key: Key) -> bool[src]

Returns whether or not the requested key is pressed

pub fn is_shift_down(&self) -> bool[src]

Returns whether or not any shift key is down.

pub fn is_alt_down(&self) -> bool[src]

Returns whether or not any alt key is down.

pub fn is_ctrl_down(&self) -> bool[src]

Returns whether or not any control key is down.

pub fn is_home_down(&self) -> bool[src]

Returns whether or not any home key is down.

Trait Implementations

impl Clone for KeyboardState[src]

impl Debug for KeyboardState[src]

impl Default for KeyboardState[src]

impl PartialEq<KeyboardState> for KeyboardState[src]

impl StructuralPartialEq for KeyboardState[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<E> Component for E where
    E: Any
[src]

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

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

impl<T> SetParameter for T

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<V, T> VZip<V> for T where
    V: MultiLane<T>,