mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-17 15:24:19 +00:00
9 lines
380 B
TypeScript
9 lines
380 B
TypeScript
const CAPTION_NUDGE_KEYS = new Set(["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"]);
|
|
|
|
type CaptionNudgeKeyEvent = Pick<KeyboardEvent, "altKey" | "ctrlKey" | "metaKey" | "key">;
|
|
|
|
export function shouldHandleCaptionNudgeKey(event: CaptionNudgeKeyEvent): boolean {
|
|
if (event.metaKey || event.ctrlKey || event.altKey) return false;
|
|
return CAPTION_NUDGE_KEYS.has(event.key);
|
|
}
|