From 0ac24d776e279de7efa142fe610908b777cb79ad Mon Sep 17 00:00:00 2001 From: Justin Oros Date: Thu, 14 May 2026 15:14:15 -0700 Subject: [PATCH] =?UTF-8?q?Fix=20gamepad=20letter=20selection=20on=20name?= =?UTF-8?q?=20screen=20=E2=80=94=20dispatch=20pointerdown=20instead=20of?= =?UTF-8?q?=20click?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/game.js b/game.js index 515133b..8a75706 100644 --- a/game.js +++ b/game.js @@ -666,10 +666,13 @@ class Game { keys.forEach((k, i) => k.style.outline = i === c ? '2px solid #f8c030' : ''); } - if (justPressed(0)) { /* A — select letter */ - keys[this._gpKeyCursor]?.click(); + if (justPressed(0) || justPressed(1)) { /* A or B — select highlighted letter */ + const key = keys[this._gpKeyCursor]; + if (key) { + key.dispatchEvent(new PointerEvent('pointerdown', { bubbles: true, isPrimary: true })); + } } - if (justPressed(1) || justPressed(2)) { /* B or X — delete */ + if (justPressed(2)) { /* X — delete */ this.delChar(); } if (justPressed(9) || justPressed(8)) { /* Start or Select — confirm name */