[][src]Struct buttons::Keyboard

pub struct Keyboard<Key, Mods> where
    Key: Copy + PartialEq,
    Mods: Copy + Default
{ /* fields omitted */ }

A structure representing the current state of a keyboard.

Methods

impl<Key, Mods> Keyboard<Key, Mods> where
    Key: Copy + PartialEq,
    Mods: Copy + Default
[src]

pub fn new() -> Self[src]

pub fn modifiers(&self) -> Mods[src]

Returns the current state of the modifier keys.

pub fn begin_frame_input(&mut self) -> KeyboardInput<Key, Mods>[src]

Returns a KeyboardInput structure that can be used to register changes to the state of the keyboard.

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

Returns true if the given key is currently held down.

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

Returns true if the given key was pressed this frame.

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

Returns true if the given key was released this frame.

Trait Implementations

impl<Key: Clone, Mods: Clone> Clone for Keyboard<Key, Mods> where
    Key: Copy + PartialEq,
    Mods: Copy + Default
[src]

impl<Key: Debug, Mods: Debug> Debug for Keyboard<Key, Mods> where
    Key: Copy + PartialEq,
    Mods: Copy + Default
[src]

impl<Key, Mods> Default for Keyboard<Key, Mods> where
    Key: Copy + PartialEq,
    Mods: Copy + Default
[src]

Auto Trait Implementations

impl<Key, Mods> RefUnwindSafe for Keyboard<Key, Mods> where
    Key: RefUnwindSafe,
    Mods: RefUnwindSafe

impl<Key, Mods> Send for Keyboard<Key, Mods> where
    Key: Send,
    Mods: Send

impl<Key, Mods> Sync for Keyboard<Key, Mods> where
    Key: Sync,
    Mods: Sync

impl<Key, Mods> Unpin for Keyboard<Key, Mods> where
    Key: Unpin,
    Mods: Unpin

impl<Key, Mods> UnwindSafe for Keyboard<Key, Mods> where
    Key: UnwindSafe,
    Mods: UnwindSafe

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.