ghosttyTerminalMatchesCopyShortcut function

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

Whether the current key chord should trigger terminal copy.

Implementation

bool ghosttyTerminalMatchesCopyShortcut(
  LogicalKeyboardKey key, {
  required GhosttyTerminalModifierState modifiers,
  required TargetPlatform platform,
}) {
  if (platform == TargetPlatform.macOS) {
    return modifiers.metaPressed && key == LogicalKeyboardKey.keyC;
  }
  return modifiers.controlPressed &&
      modifiers.shiftPressed &&
      key == LogicalKeyboardKey.keyC;
}