keyInput method

bool keyInput(
  1. TerminalKey key, {
  2. bool shift = false,
  3. bool alt = false,
  4. bool ctrl = false,
  5. TerminalKeyEventType type = TerminalKeyEventType.press,
  6. String? text,
})

Sends a key event to the underlying program.

See also:

Implementation

bool keyInput(
  TerminalKey key, {
  bool shift = false,
  bool alt = false,
  bool ctrl = false,
  TerminalKeyEventType type = TerminalKeyEventType.press,
  String? text,
}) {
  if (_isDisposed) return false;
  if (_keyboardActionMode) return false;
  final output = inputHandler?.call(
    TerminalKeyboardEvent(
      key: key,
      shift: shift,
      alt: alt,
      ctrl: ctrl,
      state: this,
      altBuffer: isUsingAltBuffer,
      platform: platform,
      type: type,
      text: text,
    ),
  );

  if (output != null) {
    onOutput?.call(output);
    return true;
  }

  return false;
}