Struct keyboard_types::KeyboardEvent
source · [−]pub struct KeyboardEvent {
pub state: KeyState,
pub key: Key,
pub code: Code,
pub location: Location,
pub modifiers: Modifiers,
pub repeat: bool,
pub is_composing: bool,
}
Expand description
Keyboard events are issued for all pressed and released keys.
Fields
state: KeyState
Whether the key is pressed or released.
key: Key
Logical key value.
code: Code
Physical key position.
location: Location
Location for keys with multiple instances on common keyboards.
modifiers: Modifiers
Flags for pressed modifier keys.
repeat: bool
True if the key is currently auto-repeated.
is_composing: bool
Events with this flag should be ignored in a text editor and instead composition events should be used.
Trait Implementations
sourceimpl Clone for KeyboardEvent
impl Clone for KeyboardEvent
sourcefn clone(&self) -> KeyboardEvent
fn clone(&self) -> KeyboardEvent
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 KeyboardEvent
impl Debug for KeyboardEvent
sourceimpl Default for KeyboardEvent
impl Default for KeyboardEvent
sourcefn default() -> KeyboardEvent
fn default() -> KeyboardEvent
Returns the “default value” for a type. Read more
sourceimpl<'de> Deserialize<'de> for KeyboardEvent
impl<'de> Deserialize<'de> for KeyboardEvent
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl From<KeyboardEvent> for Event
impl From<KeyboardEvent> for Event
sourcefn from(v: KeyboardEvent) -> Event
fn from(v: KeyboardEvent) -> Event
Converts to this type from the input type.
sourceimpl Hash for KeyboardEvent
impl Hash for KeyboardEvent
sourceimpl PartialEq<KeyboardEvent> for KeyboardEvent
impl PartialEq<KeyboardEvent> for KeyboardEvent
sourcefn eq(&self, other: &KeyboardEvent) -> bool
fn eq(&self, other: &KeyboardEvent) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &KeyboardEvent) -> bool
fn ne(&self, other: &KeyboardEvent) -> bool
This method tests for !=
.
sourceimpl Serialize for KeyboardEvent
impl Serialize for KeyboardEvent
impl Eq for KeyboardEvent
impl StructuralEq for KeyboardEvent
impl StructuralPartialEq for KeyboardEvent
Auto Trait Implementations
impl RefUnwindSafe for KeyboardEvent
impl Send for KeyboardEvent
impl Sync for KeyboardEvent
impl Unpin for KeyboardEvent
impl UnwindSafe for KeyboardEvent
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