Tag: touch

触摸文件,然后在Node中写入

在写入之前如何触摸文件? 尝试 fs = require 'fs' os = require 'os' path = require 'path' json_filepath = path.join os.tempdir(), 'cache', 'foo.json' module.exports = (cb) -> fs.open json_filepath, 'w', 438, (err) -> # Touch, also tried with node-touch return cb err if err? fs.writeFile json_filepath, {foo: 'bar'}, {}, (err) -> #console.error 'Error writing cache: ', err cb […]

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; // […]

触摸移动事件不正确

我忙于创build一个小型的实时绘图应用程序,并试图创build一个触摸屏系统卡住了。 这是部分工作,但当我触摸和移动线连接到最后一行。 这是我的代码: document.addEventListener("DOMContentLoaded", function() { var mouse = { click: false, move: false, pos: {x:0, y:0}, pos_prev: false, colour: "blue" }; var canvas = document.getElementById('drawing'); var ctx = canvas.getContext('2d'); var width = window.innerWidth; var height = window.innerHeight; var socket = io.connect(); canvas.width = width; canvas.height = height; /* window.onresize= function(){ var width = window.innerWidth; […]