const setupInputHandlers = (canvas, gameState) => { let mouseMoveThrottle; canvas.addEventListener('mousemove', (e) => { if (!mouseMoveThrottle) { mouseMoveThrottle = setTimeout(() => { gameState.debug.mouseX = e.clientX + gameState.camera.x; gameState.debug.mouseY = e.clientY + gameState.camera.y; mouseMoveThrottle = null; }, 16); } }); window.addEventListener('keydown', (e) => { if (e.key === 'd') { gameState.debug.enabled = !gameState.debug.enabled; } }); };