isUserInitiatedEvent method

bool isUserInitiatedEvent(
  1. String actionType, {
  2. DateTime? eventTime,
})

Check if event is user-initiated (filter ghost events)

Implementation

bool isUserInitiatedEvent(String actionType, {DateTime? eventTime}) {
  // final now = eventTime ?? DateTime.now(); // Reserved for future use

  // Real user interactions
  if (actionType == 'pointer_up' || actionType == 'long_press' || actionType == 'pan_start') {
    // _lastUserInteraction = now; // Reserved for future use
    return true;
  }

  // Focus events are not considered direct user interactions
  if (actionType == 'focus' || actionType == 'focus_out') {
    return false;
  }

  return true;
}