accept method

bool accept(
  1. int state
)

Returns whether a raw event with state counts as a new press.

Implementation

bool accept(int state) {
  if (state != 1) return false;
  final now = _clock();
  final last = _last;
  if (last != null && now.difference(last) < window) return false;
  _last = now;
  return true;
}