locked
Zoom and pinch events not fired in Desktop using javascript

    Question

  • Im trying to create a function for app idle timeout. I registered all touch events using Gesture object. Doing these static events are fired. But zoom, pinch and cursor move are not fired. Any suggestions?

    var max = 15;
    var myGesture = new MSGesture();
    myGesture.target = document.body;
    
    document.body.addEventListener("pointerdown", function (evt) {
        // adds the current mouse, pen, or touch contact for gesture recognition
        myGesture.addPointer(evt.pointerId);
    });
    document.body.addEventListener("MSGestureStart", eventListener, false);
    document.body.addEventListener("MSGestureEnd", eventListener, false);
    document.body.addEventListener("MSGestureChange", eventListener, false);
    document.body.addEventListener("MSInertiaStart", eventListener, false);
    document.body.addEventListener("MSGestureTap", eventListener, false);
    document.body.addEventListener("MSGestureHold", eventListener, false);
    setTimer();
    
    
    function setTimer() {
        if (count == max)
            window.close();
        else {
            count = count + 1;
            t = setTimeout(setTimer, 1000);
        }
    
    }
    
    
    function eventListener(evt) {
        clearTimeout(t);
        count = 0;
        setTimer();
    
    }
    }

    Thursday, November 27, 2014 4:24 AM