[][src]Struct buttons::KeyboardInput

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

An object that has methods for registering keyboard inputs this frame. It must be dropped before the underlying Keyboard can be queried.

Methods

impl<'a, Key, Mods> KeyboardInput<'a, Key, Mods> where
    Key: Copy + PartialEq,
    Mods: Copy + Default
[src]

pub fn press(&mut self, key: Key) -> &mut Self[src]

Register that a key was pressed down.

pub fn release(&mut self, key: Key) -> &mut Self[src]

Register that a key was released.

pub fn set_modifiers(&mut self, modifiers: Mods) -> &mut Self[src]

Register that the current state of the modifier keys has changed.

pub fn handle_event<E: Event<Self>>(&mut self, event: &E) -> &mut Self[src]

Convenience method for handling events. The type of event, E, will vary depending on the windowing library being used.

Trait Implementations

impl<'a> Event<KeyboardInput<'a, VirtualKeyCode, ModifiersState>> for WinitEvent[src]

impl<'a> Event<KeyboardInput<'a, VirtualKeyCode, ModifiersState>> for WindowEvent[src]

Auto Trait Implementations

impl<'a, Key, Mods> RefUnwindSafe for KeyboardInput<'a, Key, Mods> where
    Key: RefUnwindSafe,
    Mods: RefUnwindSafe

impl<'a, Key, Mods> Send for KeyboardInput<'a, Key, Mods> where
    Key: Send,
    Mods: Send

impl<'a, Key, Mods> Sync for KeyboardInput<'a, Key, Mods> where
    Key: Sync,
    Mods: Sync

impl<'a, Key, Mods> Unpin for KeyboardInput<'a, Key, Mods>

impl<'a, Key, Mods> !UnwindSafe for KeyboardInput<'a, Key, Mods>

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, 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.