mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-10-09 15:58:34 +00:00
11 lines
448 B
TypeScript
11 lines
448 B
TypeScript
type InterruptShortcutEvent = Pick<KeyboardEvent, "altKey" | "code" | "ctrlKey" | "key" | "metaKey" | "shiftKey">;
|
|
|
|
export function shouldUseUrgentTerminalInterrupt(
|
|
event: InterruptShortcutEvent,
|
|
options: { hasSelection: boolean },
|
|
): boolean {
|
|
if (options.hasSelection) return false;
|
|
if (!event.ctrlKey || event.metaKey || event.altKey || event.shiftKey) return false;
|
|
return event.code === "KeyC" || event.key.toLowerCase() === "c";
|
|
}
|