我有一个应用程序,用户必须通过使用智能设备的触摸屏来使用控制器。所以我写了一些代码来检测智能设备是否有触摸屏,如果没有,应用程序会给出错误消息。
代码如下:
var canvas,
c,
container,
// is this running in a touch capable environment?
touchable = 'createTouch' in document,
touches = []; // array of touch vectors
var firstboot = true;
lastFrameTimeSt