@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
ts 19 lines 421 Bytes
Raw
1 interface CommentSubmitShortcutEvent {
2 readonly key: string;
3 readonly metaKey: boolean;
4 readonly ctrlKey: boolean;
5 }
6
7 export function isCommentSubmitShortcut(
8 event: CommentSubmitShortcutEvent,
9 value: string,
10 pending: boolean,
11 allowEmpty = false,
12 ): boolean {
13 return (
14 !pending &&
15 (event.metaKey || event.ctrlKey) &&
16 event.key === "Enter" &&
17 (allowEmpty || value.trim().length > 0)
18 );
19 }