Struct winit::event::KeyboardInput
source · [−]pub struct KeyboardInput {
pub scancode: ScanCode,
pub state: ElementState,
pub virtual_keycode: Option<VirtualKeyCode>,
pub modifiers: ModifiersState,
}
Expand description
Describes a keyboard input event.
Fields
scancode: ScanCode
Identifies the physical key pressed
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.
state: ElementState
virtual_keycode: Option<VirtualKeyCode>
Identifies the semantic meaning of the key
Use 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.”
modifiers: ModifiersState
Deprecated in favor of WindowEvent::ModifiersChanged
Modifier keys active at the time of this input.
This is tracked internally to avoid tracking errors arising from modifier key state changes when events from this device are not being delivered to the application, e.g. due to keyboard focus being elsewhere.
Trait Implementations
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 more
sourceimpl Debug for KeyboardInput
impl Debug for KeyboardInput
sourceimpl Hash for KeyboardInput
impl Hash for KeyboardInput
sourceimpl PartialEq<KeyboardInput> for KeyboardInput
impl PartialEq<KeyboardInput> for KeyboardInput
sourcefn eq(&self, other: &KeyboardInput) -> bool
fn eq(&self, other: &KeyboardInput) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &KeyboardInput) -> bool
fn ne(&self, other: &KeyboardInput) -> bool
This method tests for !=
.
impl Copy for KeyboardInput
impl Eq for KeyboardInput
impl StructuralEq for KeyboardInput
impl StructuralPartialEq 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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more