touch webkit(nw)中的触摸事件

我意识到这里已经有一些post了(但是这个或者这个都没有回答),所以我想问一下这个问题。

我正在开发一个节点的webkit应用程序(“nw”:“^ 0.12.3”),并有问题启用触摸事件。 以下代码适用于Chrome / Chromium,但不适用于节点webkit:

document.body.addEventListener('touchstart', function(e){ alert(e.changedTouches[0].pageX); }, false); 

我已经在nw中启用了特定的标志,通过在我的package.json中添加“chromium-args”( 使用这个引用 ),我试过在这个实例中做同样的事情(见下文),但似乎没有任何工作…

 "window": { "toolbar": true, "frame": true, "icon": "icon.png", "show_in_taskbar": false, "chromium-args" : { "--enable-touch-events" : true, "--enable-pinch" : true, "--enable-touch-drag-drop" : true, "--touch-events" : true, "--enable-touch-drag-drop" : true, "--ash-touch-hud" : true } } 

也(为了什么是值得的)

 var nw = require('nw.gui'); nw.Screen.Init(); nw.Screen.screens[0].touchSupport; // returns 0 //...even though the monitor is a touchscreen ( Dell XPS ) 

属性chromium-args错误,格式错误。

 { "name": "Test aoo", "version": "0.0.0", "main": "index.html", "window": { "frame": false, "toolbar": false }, "chromium-args": "--touch-events --enable-touch-drag-drop", } 

testing它:

  console.log('ontouchstart' in window);