Changed shortcuts a bit, added a mute/unmute shortcut to control+alt+t.

This commit is contained in:
Storm Dragon
2025-11-28 01:10:56 -05:00
parent 6f1cb957c3
commit d51cb1aa90
+51 -15
View File
@@ -4749,15 +4749,17 @@ document.addEventListener('keydown', function(e) {
announcement.textContent = isRaised ? 'Hand lowered' : 'Hand raised'; announcement.textContent = isRaised ? 'Hand lowered' : 'Hand raised';
} }
// Focus on user's name button in the user list // Focus on user's name button in the user list (delayed to ensure announcement is read)
let userButton = document.getElementById('user-' + serverConnection.id); setTimeout(function() {
if(userButton) { let userButton = document.getElementById('user-' + serverConnection.id);
userButton.focus(); if(userButton) {
} userButton.focus();
}
}, 100);
} }
// Control+Shift+C - Expand or collapse chat // Control+Alt+C - Expand or collapse chat
if(e.ctrlKey && e.shiftKey && e.key === 'C') { if(e.ctrlKey && e.altKey && e.key === 'c') {
e.preventDefault(); e.preventDefault();
let leftPanel = document.getElementById('left'); let leftPanel = document.getElementById('left');
@@ -4779,10 +4781,12 @@ document.addEventListener('keydown', function(e) {
announcement.textContent = 'Chat collapsed'; announcement.textContent = 'Chat collapsed';
} }
// Focus the show-chat button // Focus the show-chat button (delayed to ensure announcement is read)
if(showChatButton) { setTimeout(function() {
showChatButton.focus(); if(showChatButton) {
} showChatButton.focus();
}
}, 100);
} else { } else {
// Expand chat // Expand chat
setVisibility('left', true); setVisibility('left', true);
@@ -4795,12 +4799,44 @@ document.addEventListener('keydown', function(e) {
announcement.textContent = 'Chat expanded'; announcement.textContent = 'Chat expanded';
} }
// Focus the close-chat button // Focus the close-chat button (delayed to ensure announcement is read)
if(closeChatButton) { setTimeout(function() {
closeChatButton.focus(); if(closeChatButton) {
} closeChatButton.focus();
}
}, 100);
} }
} }
// Control+Alt+T - Mute or unmute microphone
if(e.ctrlKey && e.altKey && e.key === 't') {
e.preventDefault();
let muteButton = document.getElementById('mutebutton');
if(!muteButton) {
return;
}
let localMute = getSettings().localMute;
if (localMute && !findUpMedia('camera')) {
displayMessage('Please use Enable to enable your camera or microphone.');
return;
}
// Toggle mute state
localMute = !localMute;
setLocalMute(localMute, true);
// Announce the action
let announcement = document.getElementById('chat-announcements');
if(announcement) {
announcement.textContent = localMute ? 'Microphone muted' : 'Microphone unmuted';
}
// Focus the mute button (delayed to ensure announcement is read)
setTimeout(function() {
muteButton.focus();
}, 100);
}
}); });
start(); start();