diff --git a/src/ui/fullscreen.ts b/src/ui/fullscreen.ts index 0c4eb27ec..98e055862 100644 --- a/src/ui/fullscreen.ts +++ b/src/ui/fullscreen.ts @@ -6,6 +6,7 @@ export class Fullscreen { if (isFullscreen) { button.classList.add('fullscreenMode'); } + this.button.addEventListener('click', this.toggle.bind(this)); } toggle() { @@ -23,8 +24,21 @@ export class Fullscreen { .querySelectorAll('.fullscreen__title') .forEach((el) => (el.textContent = 'Contract')); document.getElementById('AncientBeast').requestFullscreen(); + this.triggerF11(); } } + + triggerF11() { + const event = new KeyboardEvent('keydown', { + key: 'F11', + code: 'F11', + keyCode: 122, + which: 122, + bubbles: true, + cancelable: true, + }); + document.dispatchEvent(event); + } } /**