Towards multi-touch in the browser

But will it have a breakthough event API?

If, as it seems, the iPhone’s software will all come from Apple then all the development fun will happen in the browser, in particular in whatever version of Safari the shiny little device ships with. And it will be fun if Apple give us, as developers, access the right information. I’m talking here about that information coming from the user’s fingers. After all, who wouldn’t want to create the kind of effortlessly intuitive interfaces the Jeff Han showed off in his TED talk?

Will they let us though? There are a few directions Apple could go here.

  1. Be scrooges and filter out multiple touches before they get to us, only letting the user interact with web pages one finger at a time, the others controlling scrolling probably. Web Dev Chorus: Booooo!
  2. Give us the raw events from all touches but leave it up to us to do the hard lifting of working out which mousedown/mousemove/mouseup events came from the same finger. Web Dev Chorus: Grumble, Grumble, even huger javascript libraries, Grumble
  3. Generously preprocess the input data for us and label mouse* Events with unique “device” identifier. Web Dev Chorus: Yaaay!! Go Apple!

The iPhone definitely has javascript (and may have flash), but that’s not enough. Javascript’s current way of getting information from pointing devices like a mouse, what’s called the DOM API, has no way of distinguishing between clicks from multiple sources (nor does Flash for that matter). Neither DOM 3 nor Web Apps 1.0 has added any properties to the event object to deal with multiple pointing devices. At a minimum it would be nice to standardize on a new field of the event object that uniquely identifies the input device for the duration of a mousedown/mousemove/mouseup cycle.

I would imagine Apple will not be that pushed to let javascript know about multi-touch. It will only detract from their own installed apps and introduce potentially low standard interfaces that would nonetheless be associated with their brand. However the problem will certainly come to the fore as other companies follow Apple into the multi-touch field. We might as well think about what we’d like now.

Update: Dave Hyatt from the Safari team replies…

I’ll have much more to say about this in the coming months.

…which makes me cautiously optimistic. It must be pretty exciting to be him right now.

2 Responses to “Towards multi-touch in the browser”

  1. chris Says:

    hey eman, great article, why does the update link not seem to work though?

  2. Eureka Man Says:

    Fixed. Thanks.

Leave a Reply