keyInput method

bool keyInput(
  1. TerminalKey key, {
  2. bool shift = false,
  3. bool alt = false,
  4. bool ctrl = false,
})

Sends a key event to the underlying program.

See also:

Implementation

bool keyInput(
  TerminalKey key, {
  bool shift = false,
  bool alt = false,
  bool ctrl = false,
}) {
  final output = inputHandler?.call(
    TerminalKeyboardEvent(
      key: key,
      shift: shift,
      alt: alt,
      ctrl: ctrl,
      state: this,
      altBuffer: isUsingAltBuffer,
      platform: platform,
    ),
  );

  assert(() {
    // ignore: avoid_print
    print('[xterm:Terminal] keyInput key=$key output=${output != null ? '"${output.replaceAll('\n', '\\n')}"' : 'null'}');
    return true;
  }());

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

  return false;
}