title: How could I detect of my smart device is touchable?
body: <p>I've a application where a person must use a controller by the use of the touchscreen of the smart device. So I have written some code to detect of the smart device has a touchscreen if not the application gives an error message.</p>
  
  <p>the code is like this:</p>
  
  <pre><code>var canvas,
      c,
      container,
      // is this running in a touch capable environment?
      touchable = 'createTouch' in document,
      touches = []; // array of touch vectors
  var firstboot = true;
  lastFrameTimeStamp = new Date().getTime();
  
  function init() {
      if (touchable) {
          setupCanvas();
          setInterval(draw, 1000 / 24);
          canvas.addEventListener('touchstart', onTouchStart, false);
          canvas.addEventListener('touchmove', onTouchMove, false);
          canvas.addEventListener('touchend', onTouchEnd, false);
          window.onorientationchange = resizeCanvas;
          window.onresize = resizeCanvas;
      }
      else {
          setupCanvas();
          c.textAlign="center";
          c.fillStyle = '#000';
          c.font="18px Arial";
          c.fillText("Helaas, de controller is alleen beschikbaar voor toestellen met een touchscreen.",canvas.width/2,canvas.height/2);   
      }
  }
  </code></pre>
  
  <p>For smart devices with Android of IOS the code works fine and the touchscreen is detected. But when I try the controller on my windows 8 phone (Nokia lumia 920) I get the error message my phone has no touchscreen.</p>
  
  <p>So how could I change my code so my application detect that my windows phone is touchable?</p>