weasel API - v0.8.0
    Preparing search index...

    Function useTools

    • Manages the active tool and hotkey slot.

      It used to also own a dispatcher: useTools constructed the tool-routing dispatcher and <Canvas> pumped DOM events into it. Input now belongs entirely to useGestureDispatcher, so what's left here is slot state plus the overlay roll-up.

      Requires <ActiveToolContextProvider> (or <WeaselProvider> / <SceneCanvas>, which mount one internally) in scope: active/hotkey state lives in the context so the gesture dispatcher and any sibling useTools calls all read the same source of truth.

      First-mount-wins semantics: if opts.active differs from the context default ('select') on first mount, useTools pushes opts.active to the context via a microtask. Subsequent mounts respect whatever the context currently holds (the first caller wins).

      Parameters

      Returns ToolsApi