From 67fb2c73e431c40034e4d2eedcdff437bb84c8be Mon Sep 17 00:00:00 2001 From: aliraza556 Date: Sun, 11 Aug 2024 23:49:37 +0500 Subject: [PATCH] new changes --- src/ui/fullscreen.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/ui/fullscreen.ts b/src/ui/fullscreen.ts index 86cfa1c13..8838c1339 100644 --- a/src/ui/fullscreen.ts +++ b/src/ui/fullscreen.ts @@ -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() { @@ -34,6 +26,14 @@ export class Fullscreen { document.getElementById('AncientBeast').requestFullscreen(); } } + + private preventEscExitFullscreen() { + document.addEventListener('keydown', (event) => { + if (event.key === 'Escape' && isAppInNativeFullscreenMode()) { + event.preventDefault(); + } + }); + } } /**