pub struct KeyboardEvent {
    pub event_time: u64,
    pub device_id: u32,
    pub phase: KeyboardEventPhase,
    pub hid_usage: u32,
    pub code_point: u32,
    pub modifiers: u32,
}Expand description
KeyboardEvent represents event generated by a user’s interaction with a
keyboard.
Those events are triggered by distinct pressed state changes of the keys.
The state transitions should be as follows: PRESSED -> (REPEAT ->) RELEASED or PRESSED -> (REPEAT ->) CANCELLED
The input system will repeat those events automatically when a code_point is available.
DEPRECATED: Will be removed in favor of fuchsia.ui.input.KeyEvent.
Fields§
§event_time: u64Time the event was delivered. The time is in nanoseconds and corresponds to the monotonic time as determined by the zx_clock_get_monotonic syscall.
device_id: u32§phase: KeyboardEventPhase§hid_usage: u32Keyboard HID Usage See https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf
code_point: u32The unicode code point represented by this key event, if any. Dead keys are represented as Unicode combining characters.
If there is no unicode code point, this value is zero.
modifiers: u32Key modifiers as defined by the different kModifier constants such as
kModifierCapsLock currently pressed
Trait Implementations§
Source§impl Clone for KeyboardEvent
 
impl Clone for KeyboardEvent
Source§fn clone(&self) -> KeyboardEvent
 
fn clone(&self) -> KeyboardEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for KeyboardEvent
 
impl Debug for KeyboardEvent
Source§impl<D> Decode<KeyboardEvent, D> for KeyboardEventwhere
    D: ResourceDialect,
 
impl<D> Decode<KeyboardEvent, D> for KeyboardEventwhere
    D: ResourceDialect,
Source§fn new_empty() -> KeyboardEvent
 
fn new_empty() -> KeyboardEvent
Self. The specific value does not matter,
since it will be overwritten by decode.Source§impl<D> Encode<KeyboardEvent, D> for &KeyboardEventwhere
    D: ResourceDialect,
 
impl<D> Encode<KeyboardEvent, D> for &KeyboardEventwhere
    D: ResourceDialect,
Source§impl Hash for KeyboardEvent
 
impl Hash for KeyboardEvent
Source§impl Ord for KeyboardEvent
 
impl Ord for KeyboardEvent
Source§fn cmp(&self, other: &KeyboardEvent) -> Ordering
 
fn cmp(&self, other: &KeyboardEvent) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
    Self: Sized,
 
fn max(self, other: Self) -> Selfwhere
    Self: Sized,
Source§impl PartialEq for KeyboardEvent
 
impl PartialEq for KeyboardEvent
Source§impl PartialOrd for KeyboardEvent
 
impl PartialOrd for KeyboardEvent
Source§impl TypeMarker for KeyboardEvent
 
impl TypeMarker for KeyboardEvent
Source§type Owned = KeyboardEvent
 
type Owned = KeyboardEvent
Source§fn inline_align(_context: Context) -> usize
 
fn inline_align(_context: Context) -> usize
Source§fn inline_size(_context: Context) -> usize
 
fn inline_size(_context: Context) -> usize
inline_align.Source§fn encode_is_copy() -> bool
 
fn encode_is_copy() -> bool
Self::Owned matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned to a single memcpy. Read moreSource§fn decode_is_copy() -> bool
 
fn decode_is_copy() -> bool
Self::Owned matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned to a single memcpy.Source§impl ValueTypeMarker for KeyboardEvent
 
impl ValueTypeMarker for KeyboardEvent
Source§type Borrowed<'a> = &'a KeyboardEvent
 
type Borrowed<'a> = &'a KeyboardEvent
Encode<Self>
type cheaply obtainable from &Self::Owned. There are three cases: Read moreSource§fn borrow(
    value: &<KeyboardEvent as TypeMarker>::Owned,
) -> <KeyboardEvent as ValueTypeMarker>::Borrowed<'_>
 
fn borrow( value: &<KeyboardEvent as TypeMarker>::Owned, ) -> <KeyboardEvent as ValueTypeMarker>::Borrowed<'_>
&Self::Owned to Self::Borrowed.