melonJS
    Preparing search index...

    Variable POINTERCANCELConst

    POINTERCANCEL: "me.event.pointercancel"

    Event for a pointer the browser took away mid-press: a touch that became a scroll or a pinch, a pen lifted out of range, a system gesture. A drag that listens for POINTERUP should end on this too, or it stays stuck.
    Data passed : {me.Pointer} a Pointer object, in screen coordinates

    event.on

    import { event, input } from "melonjs";
    // a drag that ends wherever the pointer comes up, and is dropped, not
    // acted on, when the browser takes the pointer away
    input.registerPointerEvent("pointerdown", ball, () => { dragging = true; });
    event.on(event.POINTERMOVE, (pointer) => { if (dragging) aimAt(pointer); });
    event.on(event.POINTERUP, () => { if (dragging) shoot(); dragging = false; });
    event.on(event.POINTERCANCEL, () => { dragging = false; });