Struct KeyboardEvent
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: u64
Time 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: u32
Keyboard HID Usage See https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf
code_point: u32
The 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: u32
Key modifiers as defined by the different kModifier constants such as
kModifierCapsLock
currently pressed
Trait Implementations§
§impl Clone for KeyboardEvent
impl Clone for KeyboardEvent
§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 more§impl Debug for KeyboardEvent
impl Debug for KeyboardEvent
§impl<D> Decode<KeyboardEvent, D> for KeyboardEventwhere
D: ResourceDialect,
impl<D> Decode<KeyboardEvent, D> for KeyboardEventwhere
D: ResourceDialect,
§fn new_empty() -> KeyboardEvent
fn new_empty() -> KeyboardEvent
Self
. The specific value does not matter,
since it will be overwritten by decode
.§impl<D> Encode<KeyboardEvent, D> for &KeyboardEventwhere
D: ResourceDialect,
impl<D> Encode<KeyboardEvent, D> for &KeyboardEventwhere
D: ResourceDialect,
§impl Hash for KeyboardEvent
impl Hash for KeyboardEvent
§impl Ord for KeyboardEvent
impl Ord for KeyboardEvent
§impl PartialEq for KeyboardEvent
impl PartialEq for KeyboardEvent
§impl PartialOrd for KeyboardEvent
impl PartialOrd for KeyboardEvent
§impl TypeMarker for KeyboardEvent
impl TypeMarker for KeyboardEvent
§type Owned = KeyboardEvent
type Owned = KeyboardEvent
§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align
.§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 more§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.§impl ValueTypeMarker for KeyboardEvent
impl ValueTypeMarker for KeyboardEvent
§type Borrowed<'a> = &'a KeyboardEvent
type Borrowed<'a> = &'a KeyboardEvent
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read more§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
.