ghosttyTerminalMatchesPasteShortcut function

bool ghosttyTerminalMatchesPasteShortcut(
  1. LogicalKeyboardKey key, {
  2. required GhosttyTerminalModifierState modifiers,
  3. required TargetPlatform platform,
})

Whether the current key chord should trigger terminal paste.

Implementation

bool ghosttyTerminalMatchesPasteShortcut(
  LogicalKeyboardKey key, {
  required GhosttyTerminalModifierState modifiers,
  required TargetPlatform platform,
}) {
  if (platform == TargetPlatform.macOS) {
    return modifiers.metaPressed && key == LogicalKeyboardKey.keyV;
  }
  return (modifiers.controlPressed &&
          modifiers.shiftPressed &&
          key == LogicalKeyboardKey.keyV) ||
      (modifiers.shiftPressed && key == LogicalKeyboardKey.insert);
}