PointerEventResampler class Null safety
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.
read-onlyinherited
- hasPendingEvents → bool
-
Returns
true
if a call to sample can dispatch more events.read-only - isDown → bool
-
Returns
true
if pointer is currently down.read-only - isTracked → bool
-
Returns
true
if pointer is currently tracked.read-only - runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
Methods
-
addEvent(
PointerEvent event) → void -
Enqueue pointer
event
for resampling. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent 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