[object Object]

← back to Games Agentabrams

Arcade: focus iframe on game load (keyboard-primary games) + clarify Skyfire tribute credit

fd95fec4913450f11002398030ca502a0d6f6f36 · 2026-07-23 15:14:33 -0700 · Steve Abrams

Contrarian-caught: hub set frame.src without focusing the iframe, so keyboard-primary
games (Skyfire's 'press space to begin') got no key events until the user clicked in.
Verified end-to-end: after selecting a game the iframe is document.activeElement and a
real Space keypress starts Skyfire. Also fixed self-contradicting 'original clone' credit.

Files touched

Diff

commit fd95fec4913450f11002398030ca502a0d6f6f36
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Thu Jul 23 15:14:33 2026 -0700

    Arcade: focus iframe on game load (keyboard-primary games) + clarify Skyfire tribute credit
    
    Contrarian-caught: hub set frame.src without focusing the iframe, so keyboard-primary
    games (Skyfire's 'press space to begin') got no key events until the user clicked in.
    Verified end-to-end: after selecting a game the iframe is document.activeElement and a
    real Space keypress starts Skyfire. Also fixed self-contradicting 'original clone' credit.
---
 games/atmos-skyfire/index.html | 2 +-
 index.html                     | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/games/atmos-skyfire/index.html b/games/atmos-skyfire/index.html
index 6ef5f50..8cfb328 100644
--- a/games/atmos-skyfire/index.html
+++ b/games/atmos-skyfire/index.html
@@ -69,7 +69,7 @@
     <div class="cta">click or press space to fly again</div>
   </div>
 
-  <div class="credit">original © leeroy — atmos.leeroy.ca · this is an original clone</div>
+  <div class="credit">Unofficial tribute to Leeroy's ATMOS (atmos.leeroy.ca) · original build — no code or art from the original</div>
 
 <script type="importmap">
 { "imports": { "three": "./three.module.js" } }
diff --git a/index.html b/index.html
index 3aa77db..b4b6712 100644
--- a/index.html
+++ b/index.html
@@ -85,6 +85,9 @@
     if (!g) return;
     Object.keys(buttons).forEach(function (k) { buttons[k].classList.toggle('active', k === id); });
     frame.hidden = false; empty.style.display = 'none';
+    // keyboard-primary games (e.g. Skyfire) need the iframe focused or key events
+    // never reach them — setting src alone does NOT focus an iframe.
+    frame.onload = function () { try { frame.focus(); if (frame.contentWindow) frame.contentWindow.focus(); } catch (e) {} };
     frame.src = g.path + 'index.html';
     document.title = g.file + ' — games.agentabrams.com';
     try { localStorage.setItem('aa-last-game', id); } catch (e) {}

← ab05d7a Add ATMOS — Skyfire to the arcade (Three.js flyer, vendored  ·  back to Games Agentabrams  ·  Arcade hub: cache-bust the games.json fetch so new games sho 5b0bad6 →