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
| 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 | } |