Re: [whatwg] Hit regions and events

On Tue, Mar 4, 2014 at 8:30 PM, Ian Hickson <ian@hixie.ch> wrote:

> On Tue, 4 Mar 2014, Rik Cabanier wrote:
> > >
> > > So what would you do in the case where you start two touches on
> > > different regions, then move them at the same time to two other
> > > different regions at the same time? What would you put in the
> > > touchmove event's object?
>
>
The touches attribute [1] of the touch event would contain 2 touch elements.
Each touch element would have as target the canvas element and contain the
id of the hit region.
As you move, the touch elements would update their id as you enter other
regions.

Basically, everything is the same, except you hit test each touch and if
there's a hit, fill in the id.


> > This is not all that different from how the mouse events work with hit
> > regions.
>
> It's different in the important sense that there's only one mouse pointer,
> but there can be multiple ongoing touches.


Each touch acts conceptually like a mouse pointer.

1: http://www.w3.org/TR/touch-events/#widl-TouchEvent-touches

Received on Wednesday, 5 March 2014 05:00:28 UTC