mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-20 23:20:46 +00:00
* feat: complete Kitty keyboard protocol * test: document Kitty text release behavior
12 lines
527 B
TypeScript
12 lines
527 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;
|
|
if (/^[\x20-\x7e]$/.test(event.key)) return event.key.toLowerCase() === "c";
|
|
return event.code === "KeyC" || event.key.toLowerCase() === "c";
|
|
}
|