KeyboardListenerComponent constructor

KeyboardListenerComponent({
  1. Map<LogicalKeyboardKey, KeyHandlerCallback> keyUp = const {},
  2. Map<LogicalKeyboardKey, KeyHandlerCallback> keyDown = const {},
  3. ComponentKey? key,
})

A Component that receives keyboard input and executes registered methods. This component is based on KeyboardHandler, which requires the FlameGame which is used to be mixed with HasKeyboardHandlerComponents.

Implementation

KeyboardListenerComponent({
  Map<LogicalKeyboardKey, KeyHandlerCallback> keyUp = const {},
  Map<LogicalKeyboardKey, KeyHandlerCallback> keyDown = const {},
  super.key,
})  : _keyUp = keyUp,
      _keyDown = keyDown;