pub enum Event {
Show 19 variants
PointerDown {
target: u32,
x: f32,
y: f32,
secondary: bool,
},
PointerMove {
target: u32,
x: f32,
y: f32,
hovering: bool,
leaving: bool,
},
PointerUp {
target: u32,
x: f32,
y: f32,
secondary: bool,
},
KeyDown {
target: u32,
key_code: u16,
modifiers: u8,
repeat: bool,
},
KeyUp {
target: u32,
key_code: u16,
modifiers: u8,
},
ValueChanged {
target: u32,
value: f32,
},
TextChanged {
target: u32,
value: String,
},
FocusChanged {
target: u32,
focused: bool,
},
EditingChanged {
target: u32,
editing: bool,
},
Submit {
target: u32,
},
Scroll {
target: u32,
offset_x: f32,
offset_y: f32,
},
Wheel {
target: u32,
delta_x: f32,
delta_y: f32,
},
DateChanged {
target: u32,
days: i32,
millis: u32,
},
Navigate {
url: Option<String>,
},
MediaPlayStateChanged {
target: u32,
playing: bool,
},
MediaTimeUpdated {
target: u32,
seconds: f32,
},
MediaEnded {
target: u32,
},
MediaVolumeChanged {
target: u32,
volume: f32,
},
FitChanged {
target: u32,
index: f32,
},
}Expand description
A raw-input event (host → guest).
Event is not Copy: Event::TextChanged owns the new field text
and Event::Navigate owns an optional URL. Simple events round-trip
through encode/try_from as pure 16-byte opcodes; TextChanged and
Navigate with a URL are encoded/decoded at the batch level (their strings
live in the string section / event arena, referenced by a relative/absolute
offset).
Variants§
PointerDown
Pointer button pressed at a viewport-relative point.
PointerMove
Pointer moved; optionally entered/left the node (hover).
PointerUp
Pointer button released at a viewport-relative point.
KeyDown
Key pressed (possibly an auto-repeat).
KeyUp
Key released.
ValueChanged
A control’s value changed (host → guest). The renderer resolves the semantic value (e.g. a slider thumb dragged along its track) and reports it here; the guest/app writes it into its bound state.
TextChanged
A text field’s value changed (host → guest). The new text is resolved from the batch’s string section (see the doc comment on this enum).
FocusChanged
A node gained/lost focus (host → guest). Draft command 0x08.
EditingChanged
An editing session began/ended (host → guest). Draft command 0x09.
Submit
The user committed a field (host → guest). Draft command 0x0A.
Scroll
A scroll container’s offset changed (host → guest). Draft command 0x0B.
Wheel
Raw wheel/trackpad deltas (host → guest). Draft command 0x0C.
DateChanged
A DATE_PICKER’s value changed (host → guest). Draft command 0x0D;
days is I32 (pre-1970 negative), millis is millis of day.
A global navigation request (host → guest). Draft command 0x0E; never
node-keyed. url: Some(...) carries the destination URL the platform
navigated to (browser popstate/back/forward/deep-link), resolved from
the string section / event arena; url: None is a native back request.
MediaPlayStateChanged
A bound AUDIO/VIDEO node’s playback state changed (host → guest).
Draft command 0x0F; reported only when PLAYBACK_STATE is bound.
MediaTimeUpdated
A bound media node’s current playback position (host → guest). Draft
command 0x10; seconds is the position in seconds (f32), reported while
playing. An app-initiated seek (MEDIA_POSITION change) is not echoed.
MediaEnded
A bound media node reached the end of its media (host → guest). Draft command 0x11.
MediaVolumeChanged
A bound media node’s volume changed (host → guest). Draft command 0x12;
volume is in the range 0..1 (f32).
FitChanged
A SIZE_THAT_FITS slot’s selected candidate changed (host → guest).
Draft command 0x13; index is the derived fit index (f32), reported once
after the first measure and then only when it changes.
Implementations§
Source§impl Event
impl Event
Sourcepub fn encode(&self) -> Opcode
pub fn encode(&self) -> Opcode
Encode this event as a 16-byte opcode.
TextChanged and Navigate with a URL cannot be fully encoded here —
their strings live in the batch’s string section / event arena — so this
emits the opcode with a zero B offset; the batch-aware
encode_events/decode_events pair in pathland-core-transport writes
the string and its real offset.