normalizeToPointerData(event)
    {
        const normalizedEvents = [];

        if (this.supportsTouchEvents && event instanceof TouchEvent)
        {
            for (let i = 0, li = event.changedTouches.length; i < li; i++)
            {
                const touch = event.changedTouches[i];

                if (typeof touch.button === 'undefined') touch.button = event.touches.length ? 1 : 0;
                if (typeof touch.buttons === 'undefined') touch.buttons = event.touches.length ? 1 : 0;
                if (typeof touch.isPrimary === 'undefined') touch.isPrimary = event.touches.length === 1;
                if (typeof touch.width === 'undefined') touch.width = touch.radiusX || 1;
                if (typeof touch.height === 'undefined') touch.height = touch.radiusY || 1;
                if (typeof touch.tiltX === 'undefined') touch.tiltX = 0;
                if (typeof touch.tiltY === 'undefined') touch.tiltY = 0;
                if (typeof touch.pointerType === 'undefined') touch.pointerType = 'touch';
                if (typeof touch.pointerId === 'undefined') touch.pointerId = touch.identifier || 0;
                if (typeof touch.pressure === 'undefined') touch.pressure = touch.force || 0.5;
                if (typeof touch.rotation === 'undefined') touch.rotation = touch.rotationAngle || 0;

                if (typeof touch.layerX === 'undefined') touch.layerX = touch.offsetX = touch.clientX;
                if (typeof touch.layerY === 'undefined') touch.layerY = touch.offsetY = touch.clientY;

                // mark the touch as normalized, just so that we know we did it
                touch.isNormalized = true;

                normalizedEvents.push(touch);
            }
        }
        // apparently PointerEvent subclasses MouseEvent, so yay
        else if (event instanceof MouseEvent && (!this.supportsPointerEvents || !(event instanceof window.PointerEvent)))
        {
            if (typeof event.isPrimary === 'undefined') event.isPrimary = true;
            if (typeof event.width === 'undefined') event.width = 1;
            if (typeof event.height === 'undefined') event.height = 1;
            if (typeof event.tiltX === 'undefined') event.tiltX = 0;
            if (typeof event.tiltY === 'undefined') event.tiltY = 0;
            if (typeof event.pointerType === 'undefined') event.pointerType = 'mouse';
            if (typeof event.pointerId === 'undefined') event.pointerId = MOUSE_POINTER_ID;
            if (typeof event.pressure === 'undefined') event.pressure = 0.5;
            if (typeof event.rotation === 'undefined') event.rotation = 0;

            // mark the mouse event as normalized, just so that we know we did it
            event.isNormalized = true;

            normalizedEvents.push(event);
        }
        else
        {
            normalizedEvents.push(event);
        }

        return normalizedEvents;
    }
/**
     * Ensures that the original event object contains all data that a regular pointer event would have
     *
     * @private
     * @param {TouchEvent|MouseEvent|PointerEvent} event - The original event data from a touch or mouse event
     * @return {PointerEvent[]} An array containing a single normalized pointer event, in the case of a pointer
     *  or mouse event, or a multiple normalized pointer events if there are multiple changed touches
     */
Ensures that the original event object contains all data that a regular pointer event would have
@private
@param {TouchEvent|MouseEvent|PointerEvent} event - The original event data from a touch or mouse event
@return {PointerEvent[]} An array containing a single normalized pointer event, in the case of a pointer
or mouse event, or a multiple normalized pointer events if there are multiple changed touches
Ensures that the original event object contains all data that a regular pointer event would have @private @param { TouchEvent|MouseEvent|PointerEvent } event - The original event data from a touch or mouse event @return { PointerEvent [] } An array containing a single normalized pointer event in the case of a pointer or mouse event or a multiple normalized pointer events if there are multiple changed touches
normalizeToPointerData(event)
    {
        const normalizedEvents = [];
        if (this.supportsTouchEvents && event instanceof TouchEvent)
        {
            for (let i = 0, li = event.changedTouches.length; i < li; i++)
            {
                const touch = event.changedTouches[i];
                if (typeof touch.button === 'undefined') touch.button = event.touches.length ? 1 : 0;
                if (typeof touch.buttons === 'undefined') touch.buttons = event.touches.length ? 1 : 0;
                if (typeof touch.isPrimary === 'undefined') touch.isPrimary = event.touches.length === 1;
                if (typeof touch.width === 'undefined') touch.width = touch.radiusX || 1;
                if (typeof touch.height === 'undefined') touch.height = touch.radiusY || 1;
                if (typeof touch.tiltX === 'undefined') touch.tiltX = 0;
                if (typeof touch.tiltY === 'undefined') touch.tiltY = 0;
                if (typeof touch.pointerType === 'undefined') touch.pointerType = 'touch';
                if (typeof touch.pointerId === 'undefined') touch.pointerId = touch.identifier || 0;
                if (typeof touch.pressure === 'undefined') touch.pressure = touch.force || 0.5;
                if (typeof touch.rotation === 'undefined') touch.rotation = touch.rotationAngle || 0;
                if (typeof touch.layerX === 'undefined') touch.layerX = touch.offsetX = touch.clientX;
                if (typeof touch.layerY === 'undefined') touch.layerY = touch.offsetY = touch.clientY;
                touch.isNormalized = true;
                normalizedEvents.push(touch);
            }
        }
        else if (event instanceof MouseEvent && (!this.supportsPointerEvents || !(event instanceof window.PointerEvent)))
        {
            if (typeof event.isPrimary === 'undefined') event.isPrimary = true;
            if (typeof event.width === 'undefined') event.width = 1;
            if (typeof event.height === 'undefined') event.height = 1;
            if (typeof event.tiltX === 'undefined') event.tiltX = 0;
            if (typeof event.tiltY === 'undefined') event.tiltY = 0;
            if (typeof event.pointerType === 'undefined') event.pointerType = 'mouse';
            if (typeof event.pointerId === 'undefined') event.pointerId = MOUSE_POINTER_ID;
            if (typeof event.pressure === 'undefined') event.pressure = 0.5;
            if (typeof event.rotation === 'undefined') event.rotation = 0;
            event.isNormalized = true;
            normalizedEvents.push(event);
        }
        else
        {
            normalizedEvents.push(event);
        }
        return normalizedEvents;
    }
normalizeToPointerData ( event ) { const normalizedEvents = [ ] ; if ( this . supportsTouchEvents && event instanceof TouchEvent ) { for ( let i = 0 , li = event . changedTouches . length ; i < li ; i ++ ) { const touch = event . changedTouches [ i ] ; if ( typeof touch . button === 'undefined' ) touch . button = event . touches . length ? 1 : 0 ; if ( typeof touch . buttons === 'undefined' ) touch . buttons = event . touches . length ? 1 : 0 ; if ( typeof touch . isPrimary === 'undefined' ) touch . isPrimary = event . touches . length === 1 ; if ( typeof touch . width === 'undefined' ) touch . width = touch . radiusX || 1 ; if ( typeof touch . height === 'undefined' ) touch . height = touch . radiusY || 1 ; if ( typeof touch . tiltX === 'undefined' ) touch . tiltX = 0 ; if ( typeof touch . tiltY === 'undefined' ) touch . tiltY = 0 ; if ( typeof touch . pointerType === 'undefined' ) touch . pointerType = 'touch' ; if ( typeof touch . pointerId === 'undefined' ) touch . pointerId = touch . identifier || 0 ; if ( typeof touch . pressure === 'undefined' ) touch . pressure = touch . force || 0.5 ; if ( typeof touch . rotation === 'undefined' ) touch . rotation = touch . rotationAngle || 0 ; if ( typeof touch . layerX === 'undefined' ) touch . layerX = touch . offsetX = touch . clientX ; if ( typeof touch . layerY === 'undefined' ) touch . layerY = touch . offsetY = touch . clientY ; touch . isNormalized = true ; normalizedEvents . push ( touch ) ; } } else if ( event instanceof MouseEvent && ( ! this . supportsPointerEvents || ! ( event instanceof window . PointerEvent ) ) ) { if ( typeof event . isPrimary === 'undefined' ) event . isPrimary = true ; if ( typeof event . width === 'undefined' ) event . width = 1 ; if ( typeof event . height === 'undefined' ) event . height = 1 ; if ( typeof event . tiltX === 'undefined' ) event . tiltX = 0 ; if ( typeof event . tiltY === 'undefined' ) event . tiltY = 0 ; if ( typeof event . pointerType === 'undefined' ) event . pointerType = 'mouse' ; if ( typeof event . pointerId === 'undefined' ) event . pointerId = MOUSE_POINTER_ID ; if ( typeof event . pressure === 'undefined' ) event . pressure = 0.5 ; if ( typeof event . rotation === 'undefined' ) event . rotation = 0 ; event . isNormalized = true ; normalizedEvents . push ( event ) ; } else { normalizedEvents . push ( event ) ; } return normalizedEvents ; }
Ensures that the original event object contains all data that a regular pointer event would have
 @private
 @param {TouchEvent|MouseEvent|PointerEvent} event - The original event data from a touch or mouse event
 @return {PointerEvent[]} An array containing a single normalized pointer event, in the case of a pointer
  or mouse event, or a multiple normalized pointer events if there are multiple changed touches
Ensures that the original event object contains all data that a regular pointer event would have @private @param { TouchEvent|MouseEvent|PointerEvent } event - The original event data from a touch or mouse event @return { PointerEvent [] } An array containing a single normalized pointer event in the case of a pointer or mouse event or a multiple normalized pointer events if there are multiple changed touches
// mark the touch as normalized, just so that we know we did it // apparently PointerEvent subclasses MouseEvent, so yay // mark the mouse event as normalized, just so that we know we did it