etBoundingClientRect();
          const x = e.clientX;
          const y = e.clientY;
          const inRect = x >= rect.left && x < rect.right &&
                         y >= rect.top && y < rect.bottom;
          if (inRect) {
            pressed = true;
          }
          setKey(key, pressed);
        }
      };

      function handleMouseUp() {
        clearKeys();
        window.removeEventListener('pointermove', handleMouseMove, {passive: false});
        window.removeEventListener('pointerup', ha