pub struct KeyDownEvent {
pub physical_key: PhysicalKeyboardKey,
pub logical_key: LogicalKeyboardKey,
pub character: Option<String>,
pub time_stamp: Duration,
pub device_type: KeyEventDeviceType,
pub synthesized: bool,
}Expand description
An event indicating that the user has pressed a key down on the keyboard.
See also:
KeyRepeatEvent, a key event representing the user holding a key, causing repeated events.KeyUpEvent, a key event representing the user releasing a key.HardwareKeyboard, which produces this event.
Fields§
§physical_key: PhysicalKeyboardKey§logical_key: LogicalKeyboardKey§character: Option<String>See KeyEvent::character.
time_stamp: DurationSee KeyEvent::time_stamp.
device_type: KeyEventDeviceType§synthesized: boolImplementations§
Source§impl KeyDownEvent
impl KeyDownEvent
Sourcepub fn new(
physical_key: PhysicalKeyboardKey,
logical_key: LogicalKeyboardKey,
time_stamp: Duration,
) -> KeyDownEvent
pub fn new( physical_key: PhysicalKeyboardKey, logical_key: LogicalKeyboardKey, time_stamp: Duration, ) -> KeyDownEvent
Creates a key event that represents the user pressing a key.
Sourcepub fn character(self, character: impl Into<String>) -> KeyDownEvent
pub fn character(self, character: impl Into<String>) -> KeyDownEvent
Dart KeyDownEvent(character:).
Sourcepub fn device_type(self, device_type: KeyEventDeviceType) -> KeyDownEvent
pub fn device_type(self, device_type: KeyEventDeviceType) -> KeyDownEvent
Dart KeyDownEvent(deviceType:).
Sourcepub fn synthesized(self, synthesized: bool) -> KeyDownEvent
pub fn synthesized(self, synthesized: bool) -> KeyDownEvent
Dart KeyDownEvent(synthesized:).
Trait Implementations§
Source§impl Clone for KeyDownEvent
impl Clone for KeyDownEvent
Source§impl Debug for KeyDownEvent
impl Debug for KeyDownEvent
impl Eq for KeyDownEvent
Source§impl From<KeyDownEvent> for KeyEvent
impl From<KeyDownEvent> for KeyEvent
Source§fn from(event: KeyDownEvent) -> KeyEvent
fn from(event: KeyDownEvent) -> KeyEvent
Converts to this type from the input type.
Source§impl PartialEq for KeyDownEvent
impl PartialEq for KeyDownEvent
impl StructuralPartialEq for KeyDownEvent
Auto Trait Implementations§
impl Freeze for KeyDownEvent
impl RefUnwindSafe for KeyDownEvent
impl Send for KeyDownEvent
impl Sync for KeyDownEvent
impl Unpin for KeyDownEvent
impl UnsafeUnpin for KeyDownEvent
impl UnwindSafe for KeyDownEvent
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.