javascript - Input data cannot be processed in the non-chronological order - Error being thrown from WinRT -
i using below code detecting gestures
var inputmanager = (function () { var = {}; var gr; var canvas; var manipulating = false; that.manipulationhandler = function (evt) { if (evt.delta) { // } }; that.ismanipulating = function () { return manipulating; }; that.processdown = function (evt) { gr.processdownevent(evt.currentpoint); }; that.processmove = function (evt) { gr.processmoveevents(evt.intermediatepoints); }; that.processup = function (evt) { gr.processupevent(evt.currentpoint); }; that.processmouse = function (evt) { gr.processmousewheelevent(evt.currentpoint, evt.shiftkey, evt.ctrlkey); }; // following functions registered handle gesturerecognizer gesture events that.manipulationstartedhandler = function (evt) { manipulating = true; that.manipulationhandler(evt); }; that.manipulationdeltahandler = function (evt) { that.manipulationhandler(evt); }; that.manipulationendhandler = function (evt) { manipulating = false; that.manipulationhandler(evt); }; that.tappedhandler = function (evt) { }; that.initialize = function () { gr = new windows.ui.input.gesturerecognizer(); gr.gesturesettings = windows.ui.input.gesturesettings.manipulationrotate | windows.ui.input.gesturesettings.manipulationtranslatex | windows.ui.input.gesturesettings.manipulationtranslatey | windows.ui.input.gesturesettings.manipulationscale | windows.ui.input.gesturesettings.manipulationrotateinertia | windows.ui.input.gesturesettings.manipulationscaleinertia | windows.ui.input.gesturesettings.manipulationtranslateinertia | windows.ui.input.gesturesettings.tap; // turn off ui feedback gestures (we'll still see ui feedback pointerpoints) gr.showgesturefeedback = true; // register event listeners gestures configured gr.addeventlistener('manipulationstarted', that.manipulationstartedhandler); gr.addeventlistener('manipulationupdated', that.manipulationdeltahandler); gr.addeventlistener('manipulationcompleted', that.manipulationendhandler); gr.addeventlistener('tapped', that.tappedhandler); canvas = document.getelementbyid("canvas"); // register event listeners dom pointer events, these // raw touch events using feed gesturerecognizer canvas.addeventlistener('mspointerdown', that.processdown, false); canvas.addeventlistener('mspointermove', that.processmove, false); canvas.addeventlistener('mspointerup', that.processup, false); canvas.addeventlistener('mspointercancel', that.processup, false); canvas.addeventlistener('wheel', that.processmouse, false); }; return that; })();
but getting error
0x80400000 - javascript runtime error: input data cannot processed in non-chronological order.
winrt information: input data cannot processed in non-chronological order.
thrown in processmove function when tapped away crazy on device. device using multi touch tablet. adding try catch blocks around each of functions seemed fix it.
that.processdown = function (evt) { try { gr.processdownevent(evt.currentpoint); } catch (e) { } }; that.processmove = function (evt) { try { gr.processmoveevents(evt.intermediatepoints); } catch (e) { } }; that.processup = function (evt) { try { gr.processupevent(evt.currentpoint); } catch (e) { } };
is correct/best approach detecting gestures on multi touch device , handling error been thrown?
Comments
Post a Comment