From 3e99964a99f4926a12ff2f2eae3e0137ea8585ff Mon Sep 17 00:00:00 2001 From: realtradam Date: Wed, 31 May 2023 17:28:11 -0400 Subject: fix window focus issue on itch.io --- external_assets/shell.html | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/external_assets/shell.html b/external_assets/shell.html index c87a31f..91cceef 100644 --- a/external_assets/shell.html +++ b/external_assets/shell.html @@ -76,6 +76,17 @@ return canvas; })() }; + /*var elem = document.getElementById('canvas'); + elem.addEventListener('click', function(event) { + window.focus(); + elem.setFocus(); + }); + document.body.addEventListener('click', function(event) { + window.focus(); + elem.setFocus(); + });*/ + window.onload = function () { window.focus(); }; + window.onclick = function () { window.focus(); }; {{{ SCRIPT }}} -- cgit v1.2.3