javascript - WinJS gestureRecognizer - how to trap multiple gestures -


i've been using this article (and others) try , implement gesture recognition in app, , work. however, want detect multiple gestures; example, swipe, , touch. don't seem able establish whether mouseup event caused end of gesture, or single touch.

function processupevent(e) {     lastelement = e.currenttarget;     gesturerecognizer.processupevent(e.currentpoint);      processtouchevent(e.currentpoint); } 

what happens processed both. how can detect whether user has 'let go' of screen swipe, or touch?

edit:

    var recognizer = new windows.ui.input.gesturerecognizer();              recognizer.gesturesettings = windows.ui.input.gesturesettings.manipulationtranslatex     recognizer.addeventlistener('manipulationcompleted', function (e) {         var dx = e.cumulative.translation.x         //do direction here     });      var processup = function (args) {         try {             recognizer.processupevent(args.currentpoint);         }         catch (e) { }     }      canvas.addeventlistener('mspointerdown', function (args) {         try {             recognizer.processdownevent(args.currentpoint);         }         catch (e) { }     }, false);      canvas.addeventlistener('mspointermove', function (args) {         try {             recognizer.processmoveevents(args.intermediatepoints);         }         catch (e) { }      }, false);     canvas.addeventlistener('mspointerup', processup, false);     canvas.addeventlistener('mspointercancel', processup, false); 

so need handle both processup , manipulationcompleted, 1 or other.

you can have @ "input" demo in codeshow. install codeshow app (http://aka.ms/codeshowapp) , @ pointer input demo , "see code" or go source code on codeplex. hope helps.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -