onKeyEvent method

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

Implementation

KeyEventResult onKeyEvent(
  KeyEvent event,
  Set<LogicalKeyboardKey> keysPressed,
) {
  assert(
    this is! HasKeyboardHandlerComponents,
    'A keyboard event was registered by KeyboardEvents for a game also '
    'mixed with HasKeyboardHandlerComponents. Do not mix with both, '
    'HasKeyboardHandlerComponents removes the necessity of KeyboardEvents',
  );

  return KeyEventResult.handled;
}