W3C Touch Events Specification

W3C unveils the Touch Events Specification. It’s a rough draft, I guess — it doesn’t even have an official URL on www.w3.org yet. But I like it a lot.

Editor Doug Schepers did the sensible thing and started with Apple’s specification (see the index), to which he added, to my delight, a fair number of properties I suggested: radiusX/Y for the touch’s radius, force to measure the touch’s force, and touchenter and touchleave events that we are going to need badly in the future.

A few remarks:

I feel altKey, ctrlKey and shiftKey should be removed. They don’t make sense in a touchscreen context. True, Apple defines altKey (though not ctrlKey and shiftKey, oddly), but I have no clue what the Alt key is on iOS, and it likely won’t exist on any future touchscreen device, either.

The ontouchmove event handler continues firing when the touch point leaves the element it was bound to. I feel the spec could be a little clearer on that point.

Should each touchpoint have its own timestamp? Yes, I think they should. A generic timestamp for — well, something, the first touchpoint maybe — doesn’t really make sense to me.

What are the units of radiusX/Y? Pixels, of course. All other X/Y properties use them as units.
The only really interesting alternative is cm/in, but physical centimeters and inches that you can actually measure with a ruler, and not the vague shadow units defined in one crazy W3C abstraction layer or another. (W3C mishandled physical units very, very badly, and I’m afraid we’re going to pay the price now.)

The unit of force is going to be an interesting issue. The spec defines an unitless value of 0 to 1, but what exactly does 1 mean? Full force, probably, but how do we define full force? The maximum pressure the device can measure, probably.

I have my doubts about the definition of the touchcancel event.

[...] when the user places a more touch points on the touch surface than the device or implementation is configured to store, in which case the earliest touch point in the list must be removed.

Does iOS implement it like that? The other browsers don’t — that’s for sure.

But these are minor points at best. All in all this is an excellent first step towards the specification of touch events.