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§
source§impl Clone for KeyboardEvent
impl Clone for KeyboardEvent
source§fn clone(&self) -> KeyboardEvent
fn clone(&self) -> KeyboardEvent
Returns a copy 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 KeyboardEvent
impl Debug for KeyboardEvent
source§impl Default for KeyboardEvent
impl Default for KeyboardEvent
source§fn default() -> KeyboardEvent
fn default() -> KeyboardEvent
Returns the “default value” for a type. Read more
source§impl Hash for KeyboardEvent
impl Hash for KeyboardEvent
source§impl PartialEq for KeyboardEvent
impl PartialEq for KeyboardEvent
impl Eq for KeyboardEvent
impl StructuralPartialEq for KeyboardEvent
Auto Trait Implementations§
impl Freeze for KeyboardEvent
impl RefUnwindSafe for KeyboardEvent
impl Send for KeyboardEvent
impl Sync for KeyboardEvent
impl Unpin for KeyboardEvent
impl UnwindSafe for KeyboardEvent
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
source§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.