Struct async_std_hidg::KeyboardInput
source · [−]#[repr(C, packed)]pub struct KeyboardInput { /* private fields */ }
Expand description
Keyboard input report
Implementations
sourceimpl KeyboardInput
impl KeyboardInput
sourcepub fn pressed(&self) -> AllPressedKeys<'_>
pub fn pressed(&self) -> AllPressedKeys<'_>
Get iterator over pressed keys
Modifiers also returned as key codes before ordinary keys
sourcepub fn count_pressed(&self) -> usize
pub fn count_pressed(&self) -> usize
Get number of all pressed keys
sourcepub fn count_pressed_mods(&self) -> usize
pub fn count_pressed_mods(&self) -> usize
Get number of pressed modifiers
sourcepub fn count_pressed_keys(&self) -> usize
pub fn count_pressed_keys(&self) -> usize
Get number of pressed keys excepting modifiers
sourcepub fn pressed_keys(&self) -> &[Key]
pub fn pressed_keys(&self) -> &[Key]
Get slice of pressed keys excepting modifiers
sourcepub fn is_pressed_key(&self, key: Key) -> bool
pub fn is_pressed_key(&self, key: Key) -> bool
Check is key pressed excepting modifiers
sourcepub fn change_mods(&mut self, mask: Modifiers, state: bool)
pub fn change_mods(&mut self, mask: Modifiers, state: bool)
Press or release modifiers only
sourcepub fn press_mods(&mut self, mask: Modifiers)
pub fn press_mods(&mut self, mask: Modifiers)
Press modifiers only
sourcepub fn release_mods(&mut self, mask: Modifiers)
pub fn release_mods(&mut self, mask: Modifiers)
Release modifiers only
sourcepub fn change_key(&mut self, key: Key, state: bool)
pub fn change_key(&mut self, key: Key, state: bool)
Press or release key
sourcepub fn release_key(&mut self, key: Key)
pub fn release_key(&mut self, key: Key)
Release key
sourcepub fn diff(&'i self, other: &'i KeyboardInput) -> KeyStateChanges<'i>ⓘNotable traits for KeyStateChanges<'i>impl<'i> Iterator for KeyStateChanges<'i> type Item = StateChange<Key>;
pub fn diff(&'i self, other: &'i KeyboardInput) -> KeyStateChanges<'i>ⓘNotable traits for KeyStateChanges<'i>impl<'i> Iterator for KeyStateChanges<'i> type Item = StateChange<Key>;
Get key state changes between two reports
Difference of two reports
Trait Implementations
sourceimpl AsMut<[u8]> for KeyboardInput
impl AsMut<[u8]> for KeyboardInput
sourceimpl AsRef<[u8]> for KeyboardInput
impl AsRef<[u8]> for KeyboardInput
sourceimpl Clone for KeyboardInput
impl Clone for KeyboardInput
sourcefn clone(&self) -> KeyboardInput
fn clone(&self) -> KeyboardInput
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for KeyboardInput
impl Debug for KeyboardInput
sourceimpl Default for KeyboardInput
impl Default for KeyboardInput
sourcefn default() -> KeyboardInput
fn default() -> KeyboardInput
Returns the “default value” for a type. Read more
sourceimpl Extend<KeyboardInput> for KeyboardInput
impl Extend<KeyboardInput> for KeyboardInput
sourcefn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = KeyboardInput>,
fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = KeyboardInput>,
Extends a collection with the contents of an iterator. Read more
sourcefn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
sourceimpl Extend<StateChange<Key>> for KeyboardInput
impl Extend<StateChange<Key>> for KeyboardInput
sourcefn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = StateChange<Key>>,
fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = StateChange<Key>>,
Extends a collection with the contents of an iterator. Read more
sourcefn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
sourceimpl Extend<StateChange<Modifiers>> for KeyboardInput
impl Extend<StateChange<Modifiers>> for KeyboardInput
sourcefn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = StateChange<Modifiers>>,
fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = StateChange<Modifiers>>,
Extends a collection with the contents of an iterator. Read more
sourcefn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
sourceimpl<'i> Sub<&'i KeyboardInput> for &'i KeyboardInput
impl<'i> Sub<&'i KeyboardInput> for &'i KeyboardInput
type Output = KeyStateChanges<'i>
type Output = KeyStateChanges<'i>
The resulting type after applying the
-
operator.sourcefn sub(
self,
other: &'i KeyboardInput
) -> <&'i KeyboardInput as Sub<&'i KeyboardInput>>::Output
fn sub(
self,
other: &'i KeyboardInput
) -> <&'i KeyboardInput as Sub<&'i KeyboardInput>>::Output
Performs the
-
operation. Read moreimpl Copy for KeyboardInput
Auto Trait Implementations
impl RefUnwindSafe for KeyboardInput
impl Send for KeyboardInput
impl Sync for KeyboardInput
impl Unpin for KeyboardInput
impl UnwindSafe for KeyboardInput
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more