Tomi's blog & portfolio

Multi-touch events playground

March 2012

Here's a piece of my Javascript code that I use from time to time when I
develop apps that deploy touch events and wonder what's going on behind the curtains.

The code tracks all the mouse and touch events and displays the data about them. It has
helped me to see the flow of events and understand the internals of touch
data. Maybe the code provides some assistance for you too in learning or
debugging the touch events. Enjoy.

When the number of fingers exceed the maximum, a touchcancel event is received.

Source code

Below is the source code for this demo. The code should be pretty much
self-documenting. For each touch event, the finger data in the array
event.changedTouches[] is inspected. All the properties of an event object are enumerated and printed on screen.