From d8817f6b2e15d46f83a13994c16e894062b0f590 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Sun, 7 Jun 2026 18:13:28 -0400 Subject: [PATCH] Add alt+shift variants to keyboard shortcuts in case alt+control conflicts with existing shortcuts. --- distro-packages/Arch-Linux/skald-git/PKGBUILD | 2 +- static/skald.js | 22 +++++++++++-------- webserver/static_accessibility_test.go | 13 +++++++++++ 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/distro-packages/Arch-Linux/skald-git/PKGBUILD b/distro-packages/Arch-Linux/skald-git/PKGBUILD index 489b38d..04c119e 100644 --- a/distro-packages/Arch-Linux/skald-git/PKGBUILD +++ b/distro-packages/Arch-Linux/skald-git/PKGBUILD @@ -2,7 +2,7 @@ # shellcheck shell=bash disable=SC2034,SC2154 pkgname=skald-git -pkgver=0.0.0.r1539.g4f35f4b +pkgver=0.0.0.r1540.g26c7808 pkgrel=1 pkgdesc='Audio-only hall-based conferencing server' arch=('x86_64' 'aarch64') diff --git a/static/skald.js b/static/skald.js index cd480e4..cf21a78 100644 --- a/static/skald.js +++ b/static/skald.js @@ -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) { diff --git a/webserver/static_accessibility_test.go b/webserver/static_accessibility_test.go index 71c872c..202d0db 100644 --- a/webserver/static_accessibility_test.go +++ b/webserver/static_accessibility_test.go @@ -72,3 +72,16 @@ func TestHallHeadingIncludesCurrentStatus(t *testing.T) { requireFunctionContains(t, js, "gotUserMessage", "hallRecording = true") requireFunctionContains(t, js, "gotUserMessage", "hallRecording = false") } + +func TestGlobalShortcutAliasesStayDocumented(t *testing.T) { + js := readStaticFile(t, "skald.js") + + requireFunctionContains(t, js, "isGlobalShortcut", "e.altKey && (e.ctrlKey || e.shiftKey)") + requireFunctionContains(t, js, "isGlobalShortcut", "e.key.toLowerCase() === key") + requireContains(t, js, "Control+Alt+H or Alt+Shift+H: Raise or lower hand", "shortcut help") + requireContains(t, js, "Control+Alt+C or Alt+Shift+C: Expand or collapse chat", "shortcut help") + requireContains(t, js, "Control+Alt+T or Alt+Shift+T: Mute or unmute microphone", "shortcut help") + requireContains(t, js, "if(isGlobalShortcut(e, 'h'))", "hand shortcut") + requireContains(t, js, "if(isGlobalShortcut(e, 'c'))", "chat shortcut") + requireContains(t, js, "if(isGlobalShortcut(e, 't'))", "microphone shortcut") +}