因此,我一直在搞乱IE10触摸API(在Samsung Slate上进行测试),发现在按住触摸后会触发触摸释放动作。
因此,这是当我将手指放在屏幕上时触发的事件的过程:
0ms = MSPointerDown,pointerId = 0
1毫秒=指针编号= 0的MSPointerMove
〜1000ms = MSPointerUp,pointerId = 0
〜1001ms = MSPointerDown,pointerId = 1 REPEAT POINT
〜1002ms = MSPointerMove,pointerId = 1
〜1250ms = MSPointerUp,pointerId = 1
然后在REPEAT POINT处以增加的指标id重复。
这是代码:
// Setup the css on the canvas (allows for detection of MSPointerMove)
$(canvas).css("-ms-touch-action", "none");
// Initialize regular touch actions
canvas.addEventListener('MSPointerDown', TouchStart, false);
canvas.addEventListener('MSPointerMove', TouchMove, false);
canvas.addEventListener('MSPointerUp', TouchEnd, false);
// Initialize the revoking of gestures/other unwanted pieces
canvas.addEventListener("MSPointerCancel", function (e) { e.preventDefault(); }, false);
canvas.addEventListener("MSGestureInit", function (e) { if (e.preventManipulation) e.preventManipulation(); }, false);
canvas.addEventListener("MSHoldVisual", function (e) { e.preventDefault(); }, false);
这绝对可能只是Slate的问题,但我认为要求确保我没有遗漏任何东西是明智的。如果这不仅是Slate的问题,那又如何允许用户按住手指而不在大约一秒钟后触发不必要的“ MSPointerUp”事件。
最佳答案
事实证明,此问题是尚未更新驱动程序的W7 / W8 Samsung平板电脑的常见问题。
可以通过在以下位置更新驱动程序来使其工作:
http://www.samsung.com/ca/support/win8upgrade/