feat(input): add Cmd+D keyboard shortcut for dictation on web

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Mohamed Boudra
2026-01-03 19:57:59 +07:00
parent 1f9a35dafd
commit fb92eb199e

View File

@@ -189,6 +189,23 @@ export function MessageInput({
enableDuration: true,
});
// Cmd+D to toggle dictation on web
useEffect(() => {
if (!IS_WEB) return;
function handleKeyDown(event: KeyboardEvent) {
if ((event.metaKey || event.ctrlKey) && event.key === "d") {
event.preventDefault();
if (isDictating) {
cancelDictation();
} else {
startDictation();
}
}
}
window.addEventListener("keydown", handleKeyDown);
return () => window.removeEventListener("keydown", handleKeyDown);
}, [isDictating, cancelDictation, startDictation]);
// Animate overlay
useEffect(() => {
const showOverlay =