/** * Call this in the "mouse up" handler. It will take care for * resetting this object when the mouse/finger has moved too much. */ void Moved(RasterPoint _location) { if (clock.IsDefined() && manhattan_distance(location, _location) > MAX_DISTANCE_PX) Reset(); }
/** * Acts as if the user had just interacted with XCSoar. */ void ResetUserIdle() { user_idle_clock.Update(); }
/** * Reset the object, discard any previous click it may have * remembered. */ void Reset() { clock.Reset(); }
bool IsUserIdle(unsigned duration_ms) { return user_idle_clock.Check(duration_ms); }