onKeyEvent method

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

Implementation

@override
@mustCallSuper
KeyEventResult onKeyEvent(
  KeyEvent event,
  Set<LogicalKeyboardKey> keysPressed,
) {
  final blockedPropagation = !propagateToChildren<KeyboardHandler>(
    (KeyboardHandler child) => child.onKeyEvent(event, keysPressed),
  );

  // If any component received the event, return handled,
  // otherwise, ignore it.
  if (blockedPropagation) {
    return KeyEventResult.handled;
  }
  return KeyEventResult.ignored;
}