Touché: bringing touch events to non-touch browsers (how touching!). No dependencies. No code bloat.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Mouse event to touch event mapping for testing touch interfaces with desktop browsers. This means that touchstart, touchmove, and touchend are hooked up to mousedown, mousemove, and mouseend, respectively. This is generally recommended for testing purposes.

Inspired by Phantom Limb (, but seeking less bloat (no graphics) and more conformance to the properties of actual touch objects.

Live Demo

Try it in your desktop browser!


Hook me up!

You hook up events just like you would on a device (libraries will use the same methods):

document.addEventListener('touchstart', function(e){}, false);
document.addEventListener('touchmove', function(e){}, false);
document.addEventListener('touchend', function(e){}, false);

Interacting with the touch events

The main difference with touch events are the touch event arrays, which Touché gladly simulates for you:

  1. touchstart has e.touches
  2. touchmove has e.touches and e.changedTouches
  3. touchend has e.changedTouches

Because a mouse cursor is representative of just one finger, these simulated arrays will only contain one element (i.e. e.touches[0]) corresponding to one touch.


document.addEventListener('touchstart', function(e){
	e.touches[0].target;   // example: "[object HTMLPreElement]"
}, false);


Tested to work on:

  • Chrome 13+
  • Safari 5.1+
  • Firefox 7+