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

    Function usePointerStylus

    • Subscribe to pointer events on a target element (defaults to window) and expose the most recent stylus snapshot.

      Reads pointer data via pointermove (button or no button) and tracks pointerenter / pointerleave for the hovering flag. The hook does NOT consume pointerdown / pointerup — leave gesture handling to the Tool dispatcher.

      Re-renders are throttled by default to avoid storming the React scheduler with 120–240Hz stylus updates. Consumers that need every sample (e.g. recording for replay) should pass maxFps: Infinity and accept the cost, or read a ref-backed snapshot in a useFrame-style loop instead.

      Parameters

      Returns PointerStylusState