Fix game input handlers intercepting keystrokes in editor input fields

Two additional window-level keydown handlers were also capturing keys when
the pitch input (or any input/select/textarea) was focused:

1. The key remap handler (capture phase) was eating all keydown events
2. The game lane input handler was calling preventDefault() on keys like
   f, g, h, j, d, k, l, space — which are needed for typing pitch names

Both now skip when activeElement is an INPUT, TEXTAREA, or SELECT.

https://claude.ai/code/session_01TLvDyKzUQekd9hzFuEJ5YX
This commit is contained in:
Claude
2026-04-02 16:20:04 +00:00
parent 07b6b9a868
commit 8fca8cacd7
+4
View File
@@ -6497,6 +6497,8 @@ function showKeyRemapStep(){
} }
var keyRemapCooldown=false; var keyRemapCooldown=false;
window.addEventListener("keydown",function(e){ window.addEventListener("keydown",function(e){
var aeTag=document.activeElement&&document.activeElement.tagName;
if(aeTag==="INPUT"||aeTag==="TEXTAREA"||aeTag==="SELECT")return;
if(keyRemapping){ if(keyRemapping){
if(e.key==="Escape"){cancelKeyRemap();e.preventDefault();return;} if(e.key==="Escape"){cancelKeyRemap();e.preventDefault();return;}
if(keyRemapCooldown)return; if(keyRemapCooldown)return;
@@ -6512,6 +6514,8 @@ window.addEventListener("keydown",function(e){
// ── INPUT ────────────────────────────────────────────── // ── INPUT ──────────────────────────────────────────────
window.addEventListener("keydown",e=>{ window.addEventListener("keydown",e=>{
var aeTag=document.activeElement&&document.activeElement.tagName;
if(aeTag==="INPUT"||aeTag==="TEXTAREA"||aeTag==="SELECT")return;
if(keyRemapping)return; if(keyRemapping)return;
if(e.key==="Escape"){e.preventDefault();togglePause();return;} if(e.key==="Escape"){e.preventDefault();togglePause();return;}
if(paused)return; if(paused)return;