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§
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: ResourceDialect> Decode<KeyboardEvent, D> for KeyboardEvent
impl<D: ResourceDialect> Decode<KeyboardEvent, D> for KeyboardEvent
Source§impl<D: ResourceDialect> Encode<KeyboardEvent, D> for &KeyboardEvent
impl<D: ResourceDialect> Encode<KeyboardEvent, D> for &KeyboardEvent
Source§impl<D: ResourceDialect, T0: Encode<u64, D>, T1: Encode<u32, D>, T2: Encode<KeyboardEventPhase, D>, T3: Encode<u32, D>, T4: Encode<u32, D>, T5: Encode<u32, D>> Encode<KeyboardEvent, D> for (T0, T1, T2, T3, T4, T5)
impl<D: ResourceDialect, T0: Encode<u64, D>, T1: Encode<u32, D>, T2: Encode<KeyboardEventPhase, D>, T3: Encode<u32, D>, T4: Encode<u32, D>, T5: Encode<u32, D>> Encode<KeyboardEvent, D> for (T0, T1, T2, T3, T4, T5)
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
.§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.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 moreimpl Copy for KeyboardEvent
impl Eq for KeyboardEvent
impl Persistable 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§
§impl<T> Body for Twhere
T: Persistable,
impl<T> Body for Twhere
T: Persistable,
§type MarkerAtTopLevel = T
type MarkerAtTopLevel = T
§type MarkerInResultUnion = T
type MarkerInResultUnion = T
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
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)
clone_to_uninit
)