Input Events and Target Provenance
Consume server-selected targets without losing coordinate spaces, touch continuity, or keyboard ownership.
ServerToClient::InputEvent identifies a destination surface, an optional target node, and a typed event. Preserve those fields through the client bridge so the toolkit can associate an event with the correct accepted interface.
Pointer Events
Pointer traffic carries motion, button changes, and other pointer activity for the selected surface. When the server can supply target provenance, PointerTarget associates that traffic with a node, retained commit, and target-local coordinates, giving the toolkit a precise basis for dispatch.
Those target-local coordinates reflect the node's position within transformed or embedded content. A surface-local position alone does not account for translation, scaling, rotation, or clipping. Reconstructing the target from an unrelated candidate tree could therefore select the wrong control even if the pointer's position within the surface is correct.
A client should verify that target metadata belongs to the accepted scene version it is dispatching. Hera Kit performs this check in the host before delivering the event to its UI queue.
Touch Events
A touch stream keeps the target selected at Start through End or Cancel. Packets contain changes for one start target, and their point order preserves the contact lifecycle. This is particularly important when an ID is reused: a Cancel must reach the old contact before a new Start establishes another one.
Do not merge packets by touch ID in a way that discards cancellation, or retarget a moving contact solely because it crossed another node's bounds.
Keyboard Events
Keyboard events first follow the server's choice of owning surface. When that ownership changes, KeyboardFocusChanged reports loss before gain, and subsequent key traffic on the connection follows the notification. Keys already belonging to an existing stream do not transfer to the new owner.
After delivery to the surface, the toolkit directs the key to its locally focused control. For an editor, that control also manages caret and selection through its editing model. Keeping these responsibilities separate allows local control focus to change without giving the application authority over server seat policy.
Event Collection Limits
The wire contract bounds pointer buttons and touch points before allocating unbounded collections. Consumers should preserve these limits in native translations and avoid accepting larger vectors through a bypass around the codec.
See input architecture and React Native input.
Source Reference
The following files in the Hera checkout define the behavior described on this page.
crates/protocol/src/input.rscrates/protocol/src/messages.rscrates/kit/src/host/mod.rscrates/composer/src/input/seat/touch.rs