diff --git a/index.html b/index.html
index 42de701..5bdb672 100644
--- a/index.html
+++ b/index.html
@@ -1264,6 +1264,15 @@
document.exitFullscreen();
}
});
+
+ // Event listener for changes in fullscreen state (e.g., F11 or Esc key)
+ document.addEventListener('fullscreenchange', () => {
+ if (document.fullscreenElement) {
+ fullscreenElement.checked = true;
+ } else {
+ windowedElement.checked = true;
+ }
+ });
});