pub struct KeyboardInput {
pub scan_code: ScanCode,
pub key_code: Option<VirtualKeyCode>,
pub state: ElementState,
pub modifiers: ModifiersState,
}Expand description
Keyboard input.
Fields§
§scan_code: ScanCodeScan code of the physical key.
This should not change if the user adjusts the host’s keyboard map. Use when the physical location of the key is more important than the key’s host GUI semantics, such as for movement controls in a first-person game.
key_code: Option<VirtualKeyCode>Virtual key code indentifying the semantic meaning of the key.
Use this when the semantics of the key are more important than the physical location of the key, such as when implementing appropriate behavior for “page up”.
state: ElementStateState of the key (pressed or released).
modifiers: ModifiersStateKeyboard modifiers that were active at the time of the event.
Trait Implementations§
Source§impl Clone for KeyboardInput
impl Clone for KeyboardInput
Source§fn clone(&self) -> KeyboardInput
fn clone(&self) -> KeyboardInput
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KeyboardInput
impl Debug for KeyboardInput
Source§impl Hash for KeyboardInput
impl Hash for KeyboardInput
Source§impl Ord for KeyboardInput
impl Ord for KeyboardInput
Source§fn cmp(&self, other: &KeyboardInput) -> Ordering
fn cmp(&self, other: &KeyboardInput) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for KeyboardInput
impl PartialEq for KeyboardInput
Source§impl PartialOrd for KeyboardInput
impl PartialOrd for KeyboardInput
impl Copy for KeyboardInput
impl Eq for KeyboardInput
impl StructuralPartialEq for KeyboardInput
Auto Trait Implementations§
impl Freeze for KeyboardInput
impl RefUnwindSafe for KeyboardInput
impl Send for KeyboardInput
impl Sync for KeyboardInput
impl Unpin for KeyboardInput
impl UnwindSafe for KeyboardInput
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.