mouseInput method

bool mouseInput(
  1. TerminalMouseButton button,
  2. TerminalMouseButtonState buttonState,
  3. CellOffset position
)

Handle a mouse event and return true if it was handled.

position is a buffer position (row 0 is the oldest scrollback line), passed to mouseHandler unchanged, as in xterm.

Implementation

bool mouseInput(
  TerminalMouseButton button,
  TerminalMouseButtonState buttonState,
  CellOffset position,
) {
  final output = mouseHandler?.call(
    TerminalMouseEvent(
      button: button,
      buttonState: buttonState,
      position: position,
      state: this,
      platform: platform,
    ),
  );
  if (output != null) {
    _emit(output);
    return true;
  }
  return false;
}