Skip to content

Commit

Permalink
Fix [BUG] Hotkeys Not Working After Using Fullscreen Button Persists #…
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrews54757 committed Oct 31, 2024
1 parent d92da07 commit e70133f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 0 additions & 1 deletion chrome/player/ui/InterfaceController.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,6 @@ export class InterfaceController {
const newValue = force === undefined ? !document.fullscreenElement : force;
if (newValue) {
await document.documentElement.requestFullscreen();
DOMElements.playerContainer.focus();
} else if (document.exitFullscreen && document.fullscreenElement) {
document.exitFullscreen();
}
Expand Down
6 changes: 6 additions & 0 deletions chrome/player/ui/KeybindManager.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@ export class KeybindManager extends EventEmitter {
this.keybindMap.set(keybind, DefaultKeybinds[keybind]);
}
}

DOMElements.playerContainer.addEventListener('keydown', (e) => {
this.onKeyDown(e);
});

document.addEventListener('keydown', (e) => {
this.onKeyDown(e);
});

this.on('HidePlayer', (e) => {
this.client.interfaceController.toggleHide();
});
Expand Down Expand Up @@ -269,6 +274,7 @@ export class KeybindManager extends EventEmitter {

if (this.handleKeyString(keyString, e)) {
e.preventDefault();
e.stopPropagation();
}
}
}

0 comments on commit e70133f

Please sign in to comment.