PointerEventResampler class
Class for pointer event resampling.
An instance of this class can be used to resample one sequence of pointer events. Multiple instances are expected to be used for multi-touch support. The sampling frequency and the sampling offset is determined by the caller.
This can be used to get smooth touch event processing at the cost of adding some latency. Devices with low frequency sensors or when the frequency is not a multiple of the display frequency (e.g., 120Hz input and 90Hz display) benefit from this.
The following pointer event types are supported: PointerAddedEvent, PointerHoverEvent, PointerDownEvent, PointerMoveEvent, PointerCancelEvent, PointerUpEvent, PointerRemovedEvent.
Resampling is currently limited to event position and delta. All pointer event types except PointerAddedEvent will be resampled. PointerHoverEvent and PointerMoveEvent will only be generated when the position has changed.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasPendingEvents → bool
-
Returns
true
if a call to sample can dispatch more events.no setter - isDown → bool
-
Returns
true
if pointer is currently down.no setter - isTracked → bool
-
Returns
true
if pointer is currently tracked.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addEvent(
PointerEvent event) → void -
Enqueue pointer
event
for resampling. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sample(
Duration sampleTime, Duration nextSampleTime, HandleEventCallback callback) → void -
Dispatch resampled pointer events for the specified
sampleTime
by callingcallback
. -
stop(
HandleEventCallback callback) → void - Stop resampling.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited