Add and remove event listeners for pointermove on document

This commit is contained in:
2026-04-03 02:37:34 +02:00
parent a66f57faff
commit ae6becb14a

View File

@@ -1511,10 +1511,12 @@ export function App({ store, initialStatusMessage }: AppProps) {
setStatusMessage(editorState.selection.kind === "none" ? "Framed the authored scene in the viewport." : "Framed the current selection.");
};
document.addEventListener("pointermove", handleWindowPointerMove);
window.addEventListener("pointermove", handleWindowPointerMove);
window.addEventListener("keydown", handleWindowKeyDown);
return () => {
document.removeEventListener("pointermove", handleWindowPointerMove);
window.removeEventListener("pointermove", handleWindowPointerMove);
window.removeEventListener("keydown", handleWindowKeyDown);
};