function getTouchPos(canvas, e, i) {
  i = i || 0;
  var rect = canvas.getBoundingClientRect();
  var touch = e.touches[i] || e.changedTouches[i];
  return  {
    x: touch.clientX - rect.left,
    y: touch.clientY - rect.top
  };
}
The touchStarted() function is called once after every time a touch is
registered. If no touchStarted() function is defined, the mousePressed()
function will be called instead if it is defined. Browsers may have
different default
behaviors attached to various touch events. To prevent any default
behavior for this event, add `return false` to the end of the method.

@method touchStarted
@example
<div>
<code>
// Touch within the image to change
// the value of the rectangle

var value = 0;
function draw() {
  fill(value);
  rect(25, 25, 50, 50);
}
function touchStarted() {
  if (value == 0) {
    value = 255;
  } else {
    value = 0;
  }
}
</code>
</div>

<div class="norender">
<code>
function touchStarted() {
  ellipse(touchX, touchY, 5, 5);
  // prevent default
  return false;
}
</code>
</div>