[−][src]Struct buttons::Keyboard
A structure representing the current state of a keyboard.
Methods
impl<Key, Mods> Keyboard<Key, Mods> where
Key: Copy + PartialEq,
Mods: Copy + Default,
[src]
Key: Copy + PartialEq,
Mods: Copy + Default,
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]
Key: Copy + PartialEq,
Mods: Copy + Default,
impl<Key: Debug, Mods: Debug> Debug for Keyboard<Key, Mods> where
Key: Copy + PartialEq,
Mods: Copy + Default,
[src]
Key: Copy + PartialEq,
Mods: Copy + Default,
impl<Key, Mods> Default for Keyboard<Key, Mods> where
Key: Copy + PartialEq,
Mods: Copy + Default,
[src]
Key: Copy + PartialEq,
Mods: Copy + Default,
Auto Trait Implementations
impl<Key, Mods> RefUnwindSafe for Keyboard<Key, Mods> where
Key: RefUnwindSafe,
Mods: RefUnwindSafe,
Key: RefUnwindSafe,
Mods: RefUnwindSafe,
impl<Key, Mods> Send for Keyboard<Key, Mods> where
Key: Send,
Mods: Send,
Key: Send,
Mods: Send,
impl<Key, Mods> Sync for Keyboard<Key, Mods> where
Key: Sync,
Mods: Sync,
Key: Sync,
Mods: Sync,
impl<Key, Mods> Unpin for Keyboard<Key, Mods> where
Key: Unpin,
Mods: Unpin,
Key: Unpin,
Mods: Unpin,
impl<Key, Mods> UnwindSafe for Keyboard<Key, Mods> where
Key: UnwindSafe,
Mods: UnwindSafe,
Key: UnwindSafe,
Mods: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,