Skip to content

Documentation / @finchart/core / index / InputRouter

Class: InputRouter ​

Defined in: packages/core/src/interaction/input-router.ts:132

The input stack. Pointers pass through here, not gestures — once something has been translated into a pan, there's no longer any way to say "this drag is mine."

Capture is implemented right here: once a consumer consumes a pointerdown, that same pointer's move/up goes straight to it without re-walking the stack, and releases on up. This single rule is how a drawing tool "takes over the drag" — no consumer needs to rewrite its own state machine for it.

Constructors ​

Constructor ​

new InputRouter(): InputRouter

Returns ​

InputRouter

Methods ​

add() ​

add(consumer, options?): () => void

Defined in: packages/core/src/interaction/input-router.ts:137

Parameters ​

consumer ​

InputConsumer

options? ​

InputConsumerOptions = {}

Returns ​

() => void


route() ​

route(event): boolean

Defined in: packages/core/src/interaction/input-router.ts:165

true = the stack consumed it. The caller must not apply the default gesture.

Parameters ​

event ​

InputEvent

Returns ​

boolean