GH_MouseTracker

public class GH_MouseTracker
Record mouse-movements over time.

Constructors

GH_MouseTracker

#
public GH_MouseTracker()
Create a new mouse tracker.

GH_MouseTracker

#
public GH_MouseTracker(Point initialPosition, object tag)
Create a new mouse tracker.
initialPosition (Point)First point in tracker.
tag (object)First tag in tracker.

GH_MouseTracker

#
public GH_MouseTracker(Point initialPosition)
Create a new mouse tracker.
initialPosition (Point)First point in tracker.

Properties

Duration

#
public TimeSpan Duration { get; }
Gets the timespan that has passed between the oldest and youngest recorded frames. This is not the same as the time that has passed since recording began.

FrameCount

#
public int FrameCount { get; }
Gets the number of recorded frames.

MaximumDuration

#
public TimeSpan MaximumDuration { get; set; }
Gets or sets the maximum allowed duration of the entire record. When new frames are recorded, old frames that are more distant than MaximumDuration will be dropped. The default duration is 10 seconds.

MaximumFrameCount

#
public int MaximumFrameCount { get; set; }
Gets or sets the maximum number of frames to keep in history. If more frames are added, the oldest ones will be dropped. The default is 16,384 frames.

NewestFrame

#
public GH_TrackerFrame NewestFrame { get; }
Gets the most recent frame in recorded history.

OldestFrame

#
public GH_TrackerFrame OldestFrame { get; }
Gets the oldest frame in recorded history.

TemporalAccuracy

#
public TimeSpan TemporalAccuracy { get; set; }
Gets or sets the maximum temporal accuracy. Frames that are closer together than the accuracy will not be recorded. The default accuracy equals 5ms.

Indexers

Frame

#
public GH_TrackerFrame this[int index] { get; }
Gets the position (in control coordinates) of the frame at the given index.
index (int)

Methods

Deviation

#
public double Deviation()
Gets the maximum deviation of the recorded mouse path. The maximum deviation is the furthest distance the mouse has been from the first point in the history record.

Deviation

#
public double Deviation(DateTime t0, DateTime t1)
Gets the maximum deviation of the recorded mouse path. The maximum deviation is the furthest distance the mouse has been from the first point in the history span. It does not measure the largest deviation between any two points in the time span, only the first and any subsequent point.
t0 (DateTime)Represents the earliest time to include.
t1 (DateTime)Represents the latest time to include.

DropFrames

#
public void DropFrames(DateTime timeLimit)
Drop all frames older than a given limit.
timeLimit (DateTime)All frames older than the limit will be dropped.

DropFrames

#
public void DropFrames(double deviation, Point anchor)
Find the youngest frame that deviates too much from the given locus and drop it and everything preceding it.
deviation (double)Local deviation.
anchor (Point)

DropFrames

#
public void DropFrames(double deviation)
Find the youngest frame that deviates too much from the current locus and drop it and everything preceding it.
deviation (double)Local deviation.

LastFrameWithinDeviation

#
public int LastFrameWithinDeviation(double deviation)
Starting from the youngest frame, finds the oldest frame that is still within a maximum deviation of the youngest frame.
deviation (double)Maximum allowed deviation.
The index of the oldest frame with a distance less than the deviation from the youngest frame, or -1 if no such frame could be found.

Record

#
public void Record(Point position, object tag)
Record a new mouse event frame. If this frame is closer than [Accuracy]ms to the previously recorded frame, it is not included.
position (Point)Location of new frame.
tag (object)

Record

#
public void Record(Point position)
Record a new mouse event frame. If this frame is closer than [Accuracy]ms to the previously recorded frame, it is not included.
position (Point)Location of new frame.

ToString

#
public override string ToString()
Object.ToString