Input Dispatch Internals
Connect confirmed server targets to accepted local callbacks, focus, and cancellation.
A successful hit test establishes only the beginning of input dispatch. The toolkit must continue associating the stream with its accepted control, the geometry used for targeting, and the environment in which the handler was published. These relationships let interactions finish or cancel coherently while newer scenes are being evaluated.
Host Boundary Validation
The server can supply PointerTarget metadata containing a retained commit and node-local geometry. Kit retains it only when the commit matches the host's confirmed commit and the node matches the message target.
Confirmation and input travel through the same ordered UI command queue. Using target geometry from a different accepted or candidate version would break that correspondence.
Accepted Tree Dispatch
A candidate can describe different handlers, remove a control, or replace its environment provider before the server accepts the change. During that interval, dispatch continues using the accepted handlers. Rejection leaves those handlers active because the proposed geometry never became the retained baseline.
Input lineage records enough ownership to handle continuation and cancellation across relevant tree changes. A removed control may still need a final cancellation callback in its original scope.
Semantic Activation and Raw Events
Semantic activation interprets pointer phases together with cancellation, disabled state, and keyboard behavior to decide when a control's action should run. Built-in buttons share that machinery. Direct pointer callbacks instead expose raw phase and position information for interactions that need to implement their own lifecycle.
A raw pointer-up handler cannot by itself establish that a press began on the control, remained valid, and was not cancelled.
Local Focus
Within a surface, FocusTarget supplies the stable control identity used by local focus handling. The server separately reports surface ownership through KeyboardFocusChanged, which must be processed before subsequent key traffic. Dispatch combines those two decisions to choose the accepted control that receives the action.
An editing service adds session identity to this chain. If focus moves to another field, a composition request for the earlier session must not reach the new field merely because it occupies the same position. Session validation keeps delayed text input attached to its original editing context.
Scroll Handoff
Nested scroll containers consume only movement they can apply and pass remaining wheel movement outward. Text fields also use accepted viewport geometry to decide how much movement they consume.
See input architecture and controls for the public-facing model.
Source Reference
The following files in the Hera checkout define the behavior described on this page.
crates/kit/src/input/lineage.rscrates/kit/src/input/activation.rscrates/kit/src/input/focus.rscrates/kit/src/input/text_input/mod.rscrates/kit/src/threading/pointer_capture.rs