Show:

Catalogues a history of touch events. Useful for creating more complex touch recognition for gestures. Currently only used by TouchInput to track previous touches to compute velocity.

TouchTracker emits these events with the following payload data:

 x             - Displacement in x-direction
 y             - Displacement in y-direction
 identifier    - DOM event touch identifier
 timestamp     - Timestamp
 count         - DOM event for number of simultaneous touches
 history       - History of touches for the gesture
 event         - Original DOM event

Constructor

Inputs.TouchTracker

(
  • [options]
)
private

Parameters:

  • [options] Object optional

    Options

    • [memory] Number optional

      Number of past touches to record in history

    • [track] Number optional

      Max simultaneous touches to record

    • [limit] Number optional

      Limit number of touches. If reached, no events are emitted

Item Index

Methods

Methods

track

(
  • id
  • data
)

Record touch data

Parameters:

untrack

(
  • id
)

Remove record of touch data

Parameters: