src/js/hammer.js
function PEhandler(ev) {
        var store = this.store;
        var removePointer = false;

        var eventTypeNormalized = ev.type.toLowerCase().replace('ms', '');
        var eventType = POINTER_INPUT_MAP[eventTypeNormalized];
        var pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType;

        var isTouch = (pointerType == INPUT_TYPE_TOUCH);

        // get index of the event in the store
        var storeIndex = inArray(store, ev.pointerId, 'pointerId');

        // start and mouse must be down
        if (eventType & INPUT_START && (ev.button === 0 || isTouch)) {
            if (storeIndex < 0) {
                store.push(ev);
                storeIndex = store.length - 1;
            }
        } else if (eventType & (INPUT_END | INPUT_CANCEL)) {
            removePointer = true;
        }

        // it not found, so the pointer hasn't been down (so it's probably a hover)
        if (storeIndex < 0) {
            return;
        }

        // update the event in the store
        store[storeIndex] = ev;

        this.callback(this.manager, eventType, {
            pointers: store,
            changedPointers: [ev],
            pointerType: pointerType,
            srcEvent: ev
        });

        if (removePointer) {
            // remove from the store
            store.splice(storeIndex, 1);
        }
    }
function PEhandler(ev) {
        var store = this.store;
        var removePointer = false;

        var eventTypeNormalized = ev.type.toLowerCase().replace('ms', '');
        var eventType = POINTER_INPUT_MAP[eventTypeNormalized];
        var pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType;

        var isTouch = (pointerType == INPUT_TYPE_TOUCH);

        // get index of the event in the store
        var storeIndex = inArray(store, ev.pointerId, 'pointerId');

        // start and mouse must be down
        if (eventType & INPUT_START && (ev.button === 0 || isTouch)) {
            if (storeIndex < 0) {
                store.push(ev);
                storeIndex = store.length - 1;
            }
        } else if (eventType & (INPUT_END | INPUT_CANCEL)) {
            removePointer = true;
        }

        // it not found, so the pointer hasn't been down (so it's probably a hover)
        if (storeIndex < 0) {
            return;
        }

        // update the event in the store
        store[storeIndex] = ev;

        this.callback(this.manager, eventType, {
            pointers: store,
            changedPointers: [ev],
            pointerType: pointerType,
            srcEvent: ev
        });

        if (removePointer) {
            // remove from the store
            store.splice(storeIndex, 1);
        }
    }
function PEhandler ( ev ) { var store = this . store ; var removePointer = false ; var eventTypeNormalized = ev . type . toLowerCase ( ) . replace ( 'ms' , '' ) ; var eventType = POINTER_INPUT_MAP [ eventTypeNormalized ] ; var pointerType = IE10_POINTER_TYPE_ENUM [ ev . pointerType ] || ev . pointerType ; var isTouch = ( pointerType == INPUT_TYPE_TOUCH ) ; // get index of the event in the store var storeIndex = inArray ( store , ev . pointerId , 'pointerId' ) ; // start and mouse must be down if ( eventType & INPUT_START && ( ev . button === 0 || isTouch ) ) { if ( storeIndex < 0 ) { store . push ( ev ) ; storeIndex = store . length - 1 ; } } else if ( eventType & ( INPUT_END | INPUT_CANCEL ) ) { removePointer = true ; } // it not found, so the pointer hasn't been down (so it's probably a hover) if ( storeIndex < 0 ) { return ; } // update the event in the store store [ storeIndex ] = ev ; this . callback ( this . manager , eventType , { pointers : store , changedPointers : [ ev ] , pointerType : pointerType , srcEvent : ev } ) ; if ( removePointer ) { // remove from the store store . splice ( storeIndex , 1 ) ; } }
handle mouse events
@param {Object} ev
handle mouse events