1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Merge pull request #6070 from dmitrylyzo/fix-hotkeys

Make hotkeys strict and prevent default actions for handled ones
This commit is contained in:
Bill Thornton 2024-09-20 14:47:33 -04:00 committed by GitHub
commit 37c8370d57
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 108 additions and 42 deletions

View file

@ -125,6 +125,9 @@ export function isInteractiveElement(element) {
export function enable() {
const hasMediaSession = 'mediaSession' in navigator;
window.addEventListener('keydown', function (e) {
// Skip modified keys
if (e.ctrlKey || e.altKey || e.metaKey || e.shiftKey) return;
const key = getKeyName(e);
// Ignore navigation keys for non-TV