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

    Interface PointerStylusState

    State exposed by usePointerStylus — the most recent stylus snapshot plus a hovering flag for the Pencil 2 / Pencil Pro "near-surface but not touching" event stream.

    interface PointerStylusState {
        altitudeAngle: number | undefined;
        azimuthAngle: number | undefined;
        hovering: boolean;
        isStylus: boolean;
        pointerType: string;
        pressure: number;
        tiltX: number;
        tiltY: number;
        twist: number;
    }

    Hierarchy (View Summary)

    Index

    Properties

    altitudeAngle: number | undefined

    Newer (Pointer Events level 3) angle in radians between the surface and the pen barrel. π/2 = perpendicular to the surface. Undefined on browsers that haven't shipped the field yet.

    azimuthAngle: number | undefined

    Newer angle in radians around the Z axis. Undefined on browsers without level-3 support.

    hovering: boolean

    True between pointerenter and pointerleave events on the target element. iPad Safari fires these for Apple Pencil hover (on iPad Pro / Pencil Pro), so this lights up when the pen is detected near the glass without contact.

    isStylus: boolean

    Convenience: pointerType === 'pen'.

    pointerType: string

    Raw pointerType from the event ('mouse' | 'pen' | 'touch' | '').

    pressure: number

    0..1. Mouse and ordinary touch report 0 when no button is held and 0.5 while a button is held (per the Pointer Events spec). Stylus inputs report a true pressure curve.

    tiltX: number

    Tilt of the pen in degrees from the surface normal, projected onto the X axis. Range ±90. Zero for mouse/touch.

    tiltY: number

    Tilt projected onto the Y axis. Range ±90. Zero for mouse/touch.

    twist: number

    Rotation of the pen barrel in degrees. Apple Pencil Pro reports this natively but Safari does NOT yet surface it via PointerEvent.twist — expect 0 there. Some Wacom stylus drivers do report it.