feat(web): desktop keyboard shortcuts
Space = play/pause, ←/→ = seek 5s, Shift+←/→ = prev/next, ↑/↓ = volume. Handler lives in player.js (where _pos/_dur/seekToMs are in scope), wired from startApp via initKeyboardShortcuts(). Ignored while typing in inputs, and yields Space to focused buttons/links so it never double-fires. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
ffa4fb35ea
commit
7498e45b16
3 files changed
+53
-1
No files matched your search
+2
-1
@@ -9,7 +9,7 @@ import {
|
||||
initProgressScrub, updateProgress, updatePreviewProgress, stopPreview,
|
||||
toggleRadioMode, starCurrent, downloadCurrent, renderQueue, playPreview,
|
||||
toggleStar, dlSongLocal, _applyRadioBtn, _applyShuffleRepeat, _restoreLastPlayed, setPlayIcon,
|
||||
npToggleStar, updateMediaSession, updateNpColorMode, reconcileNativeState,
|
||||
npToggleStar, updateMediaSession, updateNpColorMode, reconcileNativeState, initKeyboardShortcuts,
|
||||
} from './player/player.js';
|
||||
import {
|
||||
navigate, _navGoBack, _navLoad, onHeaderSearch, closeHeaderSearch,
|
||||
@@ -220,6 +220,7 @@ window.addEventListener('load', () => {
|
||||
|
||||
injectPWA();
|
||||
initProgressScrub();
|
||||
initKeyboardShortcuts();
|
||||
|
||||
// Click player-art to open Now Playing
|
||||
document.getElementById('player-art')?.addEventListener('click', openNowPlaying);
|
||||
|
||||
Reference in new issue
Block a user