From 8fca8cacd74565cf79d3aa9d353359960468f125 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 2 Apr 2026 16:20:04 +0000 Subject: [PATCH] Fix game input handlers intercepting keystrokes in editor input fields MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- index.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.html b/index.html index 698f69e..81b4656 100644 --- a/index.html +++ b/index.html @@ -6497,6 +6497,8 @@ function showKeyRemapStep(){ } var keyRemapCooldown=false; window.addEventListener("keydown",function(e){ + var aeTag=document.activeElement&&document.activeElement.tagName; + if(aeTag==="INPUT"||aeTag==="TEXTAREA"||aeTag==="SELECT")return; if(keyRemapping){ if(e.key==="Escape"){cancelKeyRemap();e.preventDefault();return;} if(keyRemapCooldown)return; @@ -6512,6 +6514,8 @@ window.addEventListener("keydown",function(e){ // ── INPUT ────────────────────────────────────────────── window.addEventListener("keydown",e=>{ + var aeTag=document.activeElement&&document.activeElement.tagName; + if(aeTag==="INPUT"||aeTag==="TEXTAREA"||aeTag==="SELECT")return; if(keyRemapping)return; if(e.key==="Escape"){e.preventDefault();togglePause();return;} if(paused)return;