Inputs.TwoFingerInput Class
Generalizes handling of two-finger touch events. Helper to PinchInput and RotateInput. This class is meant to be overridden and not used directly.
Constructor
Inputs.TwoFingerInput
()
private
Item Index
Methods
- calculateAngle static
- calculateCenter static
- calculateCenter static
- calculateDistance static
- calculateOrientation static
- detectOrientationChange static
- filter
- map
- pluck
- split
Methods
calculateAngle
(
Number
static
-
value1
-
value2
Calculates the angle between two touches relative to [0,1]. Direction option must not be set to x- or y- axes, otherwise 0 is returned.
Returns:
calculateCenter
(
Number | Array
static
-
value1
-
value2
Calculates the midpoint between two touches.
calculateCenter
(
Number | Array
static
-
velocity1
-
velocity2
Calculates the combined velocity of the two touches.
calculateDistance
(
Number
static
-
value1
-
value2
Calculates the distance between two touches.
Parameters:
Returns:
filter
(
SimpleStream
-
filterFn
Filter converts the current stream into a new stream
that only emits if the filter condition is satisfied.
The filter function should return a Boolean value.
Parameters:
-
filterFn
FunctionFunction to filter event payload
Returns:
SimpleStream:
stream Filtered stream
map
(
SimpleStream
-
mapperFn
Map converts the current stream into a new stream
with a modified (mapped) data payload.
Parameters:
-
mapperFn
FunctionFunction to map event payload
Returns:
SimpleStream:
stream Mapped stream
pluck
(
SimpleStream
-
key
Pluck is an opinionated mapper. It projects a Stream
onto one of its return values.
Useful if a Stream returns an array or object.
Returns:
SimpleStream:
stream Plucked stream
split
(
-
splitterFn
Split maps one of several streams based on custom logic.
The splitter function should return an EventEmitter type.
Parameters:
-
splitterFn
FunctionSplitter function