keyInput method

bool keyInput(
  1. TerminalKey key, {
  2. bool shift = false,
  3. bool alt = false,
  4. bool ctrl = false,
  5. bool superKey = false,
  6. bool capsLock = false,
  7. bool numLock = false,
  8. TerminalKeyEventType type = TerminalKeyEventType.press,
  9. 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,
  bool superKey = false,
  bool capsLock = false,
  bool numLock = 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,
      superKey: superKey,
      capsLock: capsLock,
      numLock: numLock,
      state: this,
      altBuffer: isUsingAltBuffer,
      platform: platform,
      type: type,
      text: text,
    ),
  );

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

  return false;
}