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:
co-authored by
Claude Opus 4.5
parent
1f9a35dafd
commit
fb92eb199e
@@ -189,6 +189,23 @@ export function MessageInput({
|
|||||||
enableDuration: true,
|
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
|
// Animate overlay
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const showOverlay =
|
const showOverlay =
|
||||||
|
|||||||
Reference in New Issue
Block a user