Skip to content

Commit

Permalink
Update config2.js
Browse files Browse the repository at this point in the history
  • Loading branch information
asgeirtj authored Jul 15, 2024
1 parent 8ff0eae commit dc3a424
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions config2.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,12 @@ function toggleVoiceInput() {
if (finishButton) {
finishButton.click();
} else {
clickElementBySelector(`button[data-element-id="voice-input-button"].rounded-md.py-1.px-1.flex.items-center.justify-center.transition-all.space-x-2.shrink-0.text-gray-500.hover\\:text-gray-900.dark\\:hover\\:text-white`);
const voiceButton = document.querySelector('button[data-element-id="voice-input-button"]');
if (voiceButton) {
voiceButton.click();
} else {
console.log("Voice input button not found");
}
}
}

Expand All @@ -99,15 +104,10 @@ document.addEventListener('keydown', function(event) {
clickElementBySelector(`button[data-element-id="new-chat-button-in-side-bar"].jsx-2562846439`);
}
// Toggle Voice Input
if (event.key === '1') {
if (event.key === '1' || event.key === '3') {
event.preventDefault();
toggleVoiceInput();
}
// Voice Input Button (kept for backward compatibility)
if (event.key === '3') {
event.preventDefault();
clickElementBySelector(`button[data-element-id="voice-input-button"].rounded-md.py-1.px-1.flex.items-center.justify-center.transition-all.space-x-2.shrink-0.text-gray-500.hover\\:text-gray-900.dark\\:hover\\:text-white`);
}
// Settings Button and Preferences
if (event.key === ',') {
event.preventDefault();
Expand Down

0 comments on commit dc3a424

Please sign in to comment.