Fix gamepad letter selection on name screen — dispatch pointerdown instead of click

This commit is contained in:
justin committed 2026-05-14 15:14:15 -07:00
1 parent 627664594b
commit 0ac24d776e
1 file changed
+6 -3
+6 -3
View File
@@ -666,10 +666,13 @@ class Game {
keys.forEach((k, i) => k.style.outline = i === c ? '2px solid #f8c030' : ''); keys.forEach((k, i) => k.style.outline = i === c ? '2px solid #f8c030' : '');
} }
if (justPressed(0)) { /* A — select letter */ if (justPressed(0) || justPressed(1)) { /* A or B — select highlighted letter */
keys[this._gpKeyCursor]?.click(); 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(); this.delChar();
} }
if (justPressed(9) || justPressed(8)) { /* Start or Select — confirm name */ if (justPressed(9) || justPressed(8)) { /* Start or Select — confirm name */