fix(keybindings): resolve 4 keyboard shortcut bugs (#95)
- Strip Shift modifier for symbol keys in eventToShortcut() so ? maps correctly - Remove duplicate Space handler in ImmersivePlayer that caused double-fire - Add bindingsVersion dependency to KeybindingsSettings for instant visual updates - Add missing uiOpenLink i18n key and use getActionLabel() fallback in modal - Add full keybindings translations to de.json and fr.json
This commit is contained in:
8 files changed
+119
-6
No files matched your search
@@ -110,6 +110,7 @@
|
|||||||
<h3 class="category-title">{getCategoryLabel(category.id)}</h3>
|
<h3 class="category-title">{getCategoryLabel(category.id)}</h3>
|
||||||
|
|
||||||
{#each actions as action}
|
{#each actions as action}
|
||||||
|
{@const _v = bindingsVersion}
|
||||||
{@const bindings = getActiveBindings()}
|
{@const bindings = getActiveBindings()}
|
||||||
<ShortcutInput
|
<ShortcutInput
|
||||||
{action}
|
{action}
|
||||||
|
|||||||
@@ -116,7 +116,7 @@
|
|||||||
{#each actions as action}
|
{#each actions as action}
|
||||||
<div class="shortcut-row">
|
<div class="shortcut-row">
|
||||||
<span class="action-label">
|
<span class="action-label">
|
||||||
{$t(`keybindings.actions.${actionIdToKey(action.id)}`) || action.label}
|
{getActionLabel(action.id)}
|
||||||
</span>
|
</span>
|
||||||
<kbd class="shortcut-key">
|
<kbd class="shortcut-key">
|
||||||
{formatShortcutDisplay(getActiveBindings()[action.id])}
|
{formatShortcutDisplay(getActiveBindings()[action.id])}
|
||||||
|
|||||||
@@ -258,10 +258,6 @@
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
toggleFullscreen();
|
toggleFullscreen();
|
||||||
break;
|
break;
|
||||||
case ' ':
|
|
||||||
e.preventDefault();
|
|
||||||
onTogglePlay();
|
|
||||||
break;
|
|
||||||
case 'ArrowLeft':
|
case 'ArrowLeft':
|
||||||
if (e.shiftKey && onSkipBack) {
|
if (e.shiftKey && onSkipBack) {
|
||||||
onSkipBack();
|
onSkipBack();
|
||||||
|
|||||||
@@ -1254,6 +1254,57 @@
|
|||||||
"expand": "Ausklappen",
|
"expand": "Ausklappen",
|
||||||
"clearFilter": "Filter löschen"
|
"clearFilter": "Filter löschen"
|
||||||
},
|
},
|
||||||
|
"keybindings": {
|
||||||
|
"title": "Tastenkürzel",
|
||||||
|
"customize": "Tastenkürzel anpassen",
|
||||||
|
"pressKeys": "Tasten drücken...",
|
||||||
|
"modified": "geändert",
|
||||||
|
"resetToDefault": "Auf Standard zurücksetzen",
|
||||||
|
"resetAll": "Alle zurücksetzen",
|
||||||
|
"resetAllConfirmTitle": "Alle Tastenkürzel zurücksetzen?",
|
||||||
|
"resetAllConfirmText": "Dies setzt alle {count} geänderten Tastenkürzel auf ihre Standardwerte zurück.",
|
||||||
|
"conflict": "\"{shortcut}\" wird bereits von \"{action}\" verwendet",
|
||||||
|
"categories": {
|
||||||
|
"playback": "Wiedergabe",
|
||||||
|
"navigation": "Navigation",
|
||||||
|
"ui": "Oberfläche",
|
||||||
|
"focus": "Fokusmodus"
|
||||||
|
},
|
||||||
|
"actions": {
|
||||||
|
"playbackToggle": "Wiedergabe / Pause",
|
||||||
|
"playbackNext": "Nächster Titel",
|
||||||
|
"playbackPrev": "Vorheriger Titel",
|
||||||
|
"navBack": "Zurück",
|
||||||
|
"navForward": "Vorwärts",
|
||||||
|
"navSearch": "Suchen",
|
||||||
|
"uiFocusMode": "Fokusmodus",
|
||||||
|
"uiQueue": "Warteschlange",
|
||||||
|
"uiEscape": "Schließen / Verwerfen",
|
||||||
|
"uiShowShortcuts": "Tastenkürzel anzeigen",
|
||||||
|
"uiOpenLink": "Musik-Link öffnen",
|
||||||
|
"focusSeekForward": "Vorspulen (5s)",
|
||||||
|
"focusSeekBack": "Zurückspulen (5s)",
|
||||||
|
"focusSeekForwardLong": "Vorspulen (10s)",
|
||||||
|
"focusSeekBackLong": "Zurückspulen (10s)"
|
||||||
|
},
|
||||||
|
"descriptions": {
|
||||||
|
"playbackToggle": "Wiedergabe umschalten",
|
||||||
|
"playbackNext": "Zum nächsten Titel springen",
|
||||||
|
"playbackPrev": "Zum vorherigen Titel gehen",
|
||||||
|
"navBack": "Zur vorherigen Seite navigieren",
|
||||||
|
"navForward": "Zur nächsten Seite navigieren",
|
||||||
|
"navSearch": "Suchfeld fokussieren",
|
||||||
|
"uiFocusMode": "Fokusmodus umschalten",
|
||||||
|
"uiQueue": "Warteschlangen-Panel umschalten",
|
||||||
|
"uiEscape": "Aktives Panel oder Modal schließen",
|
||||||
|
"uiShowShortcuts": "Tastenkürzel-Modal anzeigen",
|
||||||
|
"uiOpenLink": "Einen Qobuz-Link in der App öffnen",
|
||||||
|
"focusSeekForward": "5 Sekunden vorspulen",
|
||||||
|
"focusSeekBack": "5 Sekunden zurückspulen",
|
||||||
|
"focusSeekForwardLong": "10 Sekunden vorspulen",
|
||||||
|
"focusSeekBackLong": "10 Sekunden zurückspulen"
|
||||||
|
}
|
||||||
|
},
|
||||||
"dacWizard": {
|
"dacWizard": {
|
||||||
"title": "DAC-Einrichtungsassistent",
|
"title": "DAC-Einrichtungsassistent",
|
||||||
"triggerTooltip": "DAC-Einrichtungshilfe",
|
"triggerTooltip": "DAC-Einrichtungshilfe",
|
||||||
|
|||||||
@@ -1323,6 +1323,7 @@
|
|||||||
"uiQueue": "Queue",
|
"uiQueue": "Queue",
|
||||||
"uiEscape": "Close / Dismiss",
|
"uiEscape": "Close / Dismiss",
|
||||||
"uiShowShortcuts": "Show Shortcuts",
|
"uiShowShortcuts": "Show Shortcuts",
|
||||||
|
"uiOpenLink": "Open Music Link",
|
||||||
"focusSeekForward": "Seek Forward (5s)",
|
"focusSeekForward": "Seek Forward (5s)",
|
||||||
"focusSeekBack": "Seek Back (5s)",
|
"focusSeekBack": "Seek Back (5s)",
|
||||||
"focusSeekForwardLong": "Seek Forward (10s)",
|
"focusSeekForwardLong": "Seek Forward (10s)",
|
||||||
@@ -1339,6 +1340,7 @@
|
|||||||
"uiQueue": "Toggle queue panel",
|
"uiQueue": "Toggle queue panel",
|
||||||
"uiEscape": "Close active panel or modal",
|
"uiEscape": "Close active panel or modal",
|
||||||
"uiShowShortcuts": "Show keyboard shortcuts modal",
|
"uiShowShortcuts": "Show keyboard shortcuts modal",
|
||||||
|
"uiOpenLink": "Open a Qobuz link in the app",
|
||||||
"focusSeekForward": "Seek forward 5 seconds",
|
"focusSeekForward": "Seek forward 5 seconds",
|
||||||
"focusSeekBack": "Seek back 5 seconds",
|
"focusSeekBack": "Seek back 5 seconds",
|
||||||
"focusSeekForwardLong": "Seek forward 10 seconds",
|
"focusSeekForwardLong": "Seek forward 10 seconds",
|
||||||
|
|||||||
@@ -1323,6 +1323,7 @@
|
|||||||
"uiQueue": "Cola",
|
"uiQueue": "Cola",
|
||||||
"uiEscape": "Cerrar / Descartar",
|
"uiEscape": "Cerrar / Descartar",
|
||||||
"uiShowShortcuts": "Mostrar Atajos",
|
"uiShowShortcuts": "Mostrar Atajos",
|
||||||
|
"uiOpenLink": "Abrir Enlace Musical",
|
||||||
"focusSeekForward": "Avanzar (5s)",
|
"focusSeekForward": "Avanzar (5s)",
|
||||||
"focusSeekBack": "Retroceder (5s)",
|
"focusSeekBack": "Retroceder (5s)",
|
||||||
"focusSeekForwardLong": "Avanzar (10s)",
|
"focusSeekForwardLong": "Avanzar (10s)",
|
||||||
@@ -1339,6 +1340,7 @@
|
|||||||
"uiQueue": "Alternar panel de cola",
|
"uiQueue": "Alternar panel de cola",
|
||||||
"uiEscape": "Cerrar panel activo o modal",
|
"uiEscape": "Cerrar panel activo o modal",
|
||||||
"uiShowShortcuts": "Mostrar modal de atajos de teclado",
|
"uiShowShortcuts": "Mostrar modal de atajos de teclado",
|
||||||
|
"uiOpenLink": "Abrir un enlace de Qobuz en la app",
|
||||||
"focusSeekForward": "Avanzar 5 segundos",
|
"focusSeekForward": "Avanzar 5 segundos",
|
||||||
"focusSeekBack": "Retroceder 5 segundos",
|
"focusSeekBack": "Retroceder 5 segundos",
|
||||||
"focusSeekForwardLong": "Avanzar 10 segundos",
|
"focusSeekForwardLong": "Avanzar 10 segundos",
|
||||||
|
|||||||
@@ -1254,6 +1254,57 @@
|
|||||||
"expand": "Développer",
|
"expand": "Développer",
|
||||||
"clearFilter": "Effacer le filtre"
|
"clearFilter": "Effacer le filtre"
|
||||||
},
|
},
|
||||||
|
"keybindings": {
|
||||||
|
"title": "Raccourcis clavier",
|
||||||
|
"customize": "Personnaliser les raccourcis",
|
||||||
|
"pressKeys": "Appuyez sur les touches...",
|
||||||
|
"modified": "modifiés",
|
||||||
|
"resetToDefault": "Réinitialiser par défaut",
|
||||||
|
"resetAll": "Tout réinitialiser",
|
||||||
|
"resetAllConfirmTitle": "Réinitialiser tous les raccourcis ?",
|
||||||
|
"resetAllConfirmText": "Cela réinitialisera les {count} raccourcis modifiés à leurs valeurs par défaut.",
|
||||||
|
"conflict": "\"{shortcut}\" est déjà utilisé par \"{action}\"",
|
||||||
|
"categories": {
|
||||||
|
"playback": "Lecture",
|
||||||
|
"navigation": "Navigation",
|
||||||
|
"ui": "Interface",
|
||||||
|
"focus": "Mode focus"
|
||||||
|
},
|
||||||
|
"actions": {
|
||||||
|
"playbackToggle": "Lecture / Pause",
|
||||||
|
"playbackNext": "Piste suivante",
|
||||||
|
"playbackPrev": "Piste précédente",
|
||||||
|
"navBack": "Retour",
|
||||||
|
"navForward": "Avancer",
|
||||||
|
"navSearch": "Rechercher",
|
||||||
|
"uiFocusMode": "Mode focus",
|
||||||
|
"uiQueue": "File d'attente",
|
||||||
|
"uiEscape": "Fermer / Annuler",
|
||||||
|
"uiShowShortcuts": "Afficher les raccourcis",
|
||||||
|
"uiOpenLink": "Ouvrir un lien musical",
|
||||||
|
"focusSeekForward": "Avancer (5s)",
|
||||||
|
"focusSeekBack": "Reculer (5s)",
|
||||||
|
"focusSeekForwardLong": "Avancer (10s)",
|
||||||
|
"focusSeekBackLong": "Reculer (10s)"
|
||||||
|
},
|
||||||
|
"descriptions": {
|
||||||
|
"playbackToggle": "Basculer la lecture",
|
||||||
|
"playbackNext": "Passer à la piste suivante",
|
||||||
|
"playbackPrev": "Revenir à la piste précédente",
|
||||||
|
"navBack": "Naviguer vers la page précédente",
|
||||||
|
"navForward": "Naviguer vers la page suivante",
|
||||||
|
"navSearch": "Mettre le focus sur la recherche",
|
||||||
|
"uiFocusMode": "Basculer le mode focus",
|
||||||
|
"uiQueue": "Basculer le panneau de file d'attente",
|
||||||
|
"uiEscape": "Fermer le panneau actif ou la modale",
|
||||||
|
"uiShowShortcuts": "Afficher la modale des raccourcis clavier",
|
||||||
|
"uiOpenLink": "Ouvrir un lien Qobuz dans l'application",
|
||||||
|
"focusSeekForward": "Avancer de 5 secondes",
|
||||||
|
"focusSeekBack": "Reculer de 5 secondes",
|
||||||
|
"focusSeekForwardLong": "Avancer de 10 secondes",
|
||||||
|
"focusSeekBackLong": "Reculer de 10 secondes"
|
||||||
|
}
|
||||||
|
},
|
||||||
"dacWizard": {
|
"dacWizard": {
|
||||||
"title": "Assistant Configuration DAC",
|
"title": "Assistant Configuration DAC",
|
||||||
"triggerTooltip": "Guide de configuration DAC",
|
"triggerTooltip": "Guide de configuration DAC",
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ export function eventToShortcut(event: KeyboardEvent): string {
|
|||||||
|
|
||||||
if (event.ctrlKey || event.metaKey) parts.push('Ctrl');
|
if (event.ctrlKey || event.metaKey) parts.push('Ctrl');
|
||||||
if (event.altKey) parts.push('Alt');
|
if (event.altKey) parts.push('Alt');
|
||||||
if (event.shiftKey) parts.push('Shift');
|
|
||||||
|
|
||||||
// Normalize key
|
// Normalize key
|
||||||
let key = event.key;
|
let key = event.key;
|
||||||
@@ -38,6 +37,17 @@ export function eventToShortcut(event: KeyboardEvent): string {
|
|||||||
// Normalize space
|
// Normalize space
|
||||||
if (key === ' ') key = 'Space';
|
if (key === ' ') key = 'Space';
|
||||||
|
|
||||||
|
// Only include Shift when the key is a letter, digit, space, or named key (Arrow*, F1-F12, etc.)
|
||||||
|
// For symbol keys like ?, !, @, #, the Shift is already "consumed" by producing the symbol
|
||||||
|
if (event.shiftKey) {
|
||||||
|
const isLetter = key.length === 1 && /[a-zA-Z]/.test(key);
|
||||||
|
const isDigit = key.length === 1 && /[0-9]/.test(key);
|
||||||
|
const isNamedKey = key.length > 1; // ArrowLeft, Space, Tab, F1, etc.
|
||||||
|
if (isLetter || isDigit || isNamedKey) {
|
||||||
|
parts.push('Shift');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
parts.push(key);
|
parts.push(key);
|
||||||
return parts.join('+');
|
return parts.join('+');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user