onKeyEvent method

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

Implementation

@override
KeyEventResult onKeyEvent(
  KeyEvent event,
  Set<LogicalKeyboardKey> keysPressed,
) {
  KeyEventResult result = KeyEventResult.ignored;
  if (!enabledKeyboard) {
    return result;
  }
  for (var listener in _keyboardComponents) {
    if (listener.onKeyboard(event, keysPressed)) {
      result = KeyEventResult.handled;
    }
  }
  return result;
}