Add alt+shift variants to keyboard shortcuts in case alt+control conflicts with existing shortcuts.

This commit is contained in:
Storm Dragon
2026-06-07 18:13:28 -04:00
parent 26c7808587
commit d8817f6b2e
3 changed files with 27 additions and 10 deletions
+13 -9
View File
@@ -3152,9 +3152,9 @@ commands.help = {
cs.push(`/${cmd}${c.parameters?' ' + c.parameters:''}: ${c.description}`);
}
let shortcuts = '\n\nKeyboard shortcuts:\n' +
'Control+Alt+H: Raise or lower hand\n' +
'Control+Alt+C: Expand or collapse chat\n' +
'Control+Alt+T: Mute or unmute microphone';
'Control+Alt+H or Alt+Shift+H: Raise or lower hand\n' +
'Control+Alt+C or Alt+Shift+C: Expand or collapse chat\n' +
'Control+Alt+T or Alt+Shift+T: Mute or unmute microphone';
localMessage(cs.sort().join('\n') + shortcuts);
}
};
@@ -4173,10 +4173,14 @@ async function start() {
setViewportHeight();
}
function isGlobalShortcut(e, key) {
return e.altKey && (e.ctrlKey || e.shiftKey) && e.key.toLowerCase() === key;
}
// Global keyboard shortcuts
document.addEventListener('keydown', function(e) {
// Control+Alt+H - Raise or lower hand
if(e.ctrlKey && e.altKey && e.key.toLowerCase() === 'h') {
// Control+Alt+H or Alt+Shift+H - Raise or lower hand
if(isGlobalShortcut(e, 'h')) {
e.preventDefault();
if(!serverConnection || !serverConnection.id) {
return;
@@ -4201,8 +4205,8 @@ document.addEventListener('keydown', function(e) {
}, 100);
}
// Control+Alt+C - Expand or collapse chat
if(e.ctrlKey && e.altKey && e.key.toLowerCase() === 'c') {
// Control+Alt+C or Alt+Shift+C - Expand or collapse chat
if(isGlobalShortcut(e, 'c')) {
e.preventDefault();
let leftPanel = document.getElementById('left');
@@ -4250,8 +4254,8 @@ document.addEventListener('keydown', function(e) {
}
}
// Control+Alt+T - Mute or unmute microphone
if(e.ctrlKey && e.altKey && e.key.toLowerCase() === 't') {
// Control+Alt+T or Alt+Shift+T - Mute or unmute microphone
if(isGlobalShortcut(e, 't')) {
e.preventDefault();
let muteButton = document.getElementById('mutebutton');
if(!muteButton) {