Skip to content

Commit

Permalink
new changes
Browse files Browse the repository at this point in the history
  • Loading branch information
aliraza556 committed Aug 11, 2024
1 parent 3d5f6ba commit 67fb2c7
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/ui/fullscreen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,7 @@ export class Fullscreen {
if (isFullscreen) {
button.classList.add('fullscreenMode');
}

document.addEventListener('keydown', (event) => {
if (event.key === 'F11') {
event.preventDefault();
this.toggle();
} else if (event.shiftKey && event.key === 'F') {
this.toggle();
}
});
this.preventEscExitFullscreen();
}

toggle() {
Expand All @@ -34,6 +26,14 @@ export class Fullscreen {
document.getElementById('AncientBeast').requestFullscreen();
}
}

private preventEscExitFullscreen() {
document.addEventListener('keydown', (event) => {
if (event.key === 'Escape' && isAppInNativeFullscreenMode()) {
event.preventDefault();
}
});
}
}

/**
Expand Down

0 comments on commit 67fb2c7

Please sign in to comment.