1

我正在我的 Surface Pro 4 上测试一个项目,我在 javascript 中使用Touch 界面。根据 MDN,rotationAngleandforce属性应该分别返回 [0 - 90] 和 [0.0 - 1.0]。

但无论我如何触摸显示屏,我都会得到它们中的任何一个的固定值。在 Chrome (81) 中,它始终是00.5。在 Firefox (76) 中,返回00

代码很简单:

element.addEventListener('touchstart', function(evt) {
    // Prevent the mouse click
    evt.preventDefault();

    //-- Log the touch information
    var touch = evt.changedTouches.item(0);

    console.log(touch.radiusX);
    console.log(touch.radiusY);

    console.log(touch.rotationAngle);
    console.log(touch.force);

});

现在,关于该force属性,MDN 指定如果由于某种原因该值未知(例如设备不支持它),则返回 0.0。但是没有提到这个属性的常数 0.5 或rotationAngle.

我错过了什么吗?还是 Surface Pro 4 确实不支持这些值而我对此无能为力?

4

0 回答 0