Touch Events
Lens supports multi-touch interaction. When LuminAR registers a touch, Lens fires and event on the touched element, and this event will bubble up to parent elements.
There are three event types: lens:touchstart
is fired when a
touch begins, lens:touchmove
is fired any time a finger that is
touching moves, and lens:touchend
is fired when a finger stops
touching.
Each event has four properties: touches
is a MultiTouch
containing all fingers currently touching the surface.
targetTouches
is a MultiTouch
containing all touches that
started out on the element the event is fired on. changedTouches
is a MultiTouch
containing the subset of targetTouches
involved in the event: for a lens:touchstart
event, this will
be the fingers that started touching; for a lens:touchmove
event, this will be the fingers that moved, and for a
lens:touchend
event this will be the fingers that stopped
touching. Finally, the touch
property is a single Touch such
that touch = changedTouches[0]
.
For further discussion of these properties, see http://www.w3.org/TR/touch-events/#usage-examples and http://stackoverflow.com/a/7236327/2005979
As an alernative to watching for lens:touchmove
and lens:touchend
events,
you can use MultiTouch#moved
, MultiTouch#ended
,
Touch#moved
, and Touch#ended
.