Inputs.TouchTracker Class
samsara/inputs/TouchTracker.js:19
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
Constructor
Item Index
Methods
Methods
"on"
-
type -
handler
Adds a handler to the type channel which will be executed on emit.
get
-
key
Look up options value by key or get the full options hash.
Parameters:
-
keyStringKey
Returns:
Associated object or full options hash
getOptions
()
Alias for get
key
-
key
Return OptionsManager based on sub-object retrieved by key.
Parameters:
-
keyStringKey
Returns:
Value
off
-
type -
handler
Removes the handler from the type channel.
This undoes the work of on.
OptionsManager.patch
-
options -
patch
Constructor method. Create OptionsManager from source dictionary with arguments overriden by patch dictionary.
Parameters:
-
optionsObjectOptions to be patched
-
patch...ObjectOptions to overwrite
Returns:
source
patch
-
options
Patch options with provided patches. Triggers change event on the object.
Parameters:
-
optionsObjectPatch options
Returns:
this
set
-
key -
value
Set key to value. Outputs change event if a value is overwritten.
Returns:
Updated OptionsManager
setOptions
()
Alias for patch