Layers are processed from the highest z-index to the lowest. Within one
layer the event is handled in two passes: priority handlers (auto-tab,
wildcard fallback, multi-key sequences) are offered to every active element
first, then ordinary bindings are broadcast to every element. A sequence
consumed in the first pass therefore preempts a sibling's plain binding
regardless of element order. The first element that handles the event marks
the layer as consumed, but the ordinary pass still reaches the remaining
elements so multiple handlers can run.
If no element in the layer handled the event, the event bubbles to the
next lower layer. When no layer is left, the processor returns false
and the event continues toward the screen/page stages.
Create a processor for the layer stage.
Layers are processed from the highest z-index to the lowest. Within one layer the event is handled in two passes: priority handlers (auto-tab, wildcard fallback, multi-key sequences) are offered to every active element first, then ordinary bindings are broadcast to every element. A sequence consumed in the first pass therefore preempts a sibling's plain binding regardless of element order. The first element that handles the event marks the layer as consumed, but the ordinary pass still reaches the remaining elements so multiple handlers can run.
If no element in the layer handled the event, the event bubbles to the next lower layer. When no layer is left, the processor returns
falseand the event continues toward the screen/page stages.