onKeyEvent method

  1. @override
bool onKeyEvent(
  1. KeyEvent event,
  2. Set<LogicalKeyboardKey> keysPressed
)
override

Implementation

@override
bool onKeyEvent(KeyEvent event, Set<LogicalKeyboardKey> keysPressed) {
  final isUp = event is KeyUpEvent;

  final handlers = isUp ? _keyUp : _keyDown;
  final handler = handlers[event.logicalKey];

  if (handler != null) {
    return handler(keysPressed);
  }

  return true;
}