Add and remove event listeners for pointermove on document
This commit is contained in:
@@ -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.");
|
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("pointermove", handleWindowPointerMove);
|
||||||
window.addEventListener("keydown", handleWindowKeyDown);
|
window.addEventListener("keydown", handleWindowKeyDown);
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
|
document.removeEventListener("pointermove", handleWindowPointerMove);
|
||||||
window.removeEventListener("pointermove", handleWindowPointerMove);
|
window.removeEventListener("pointermove", handleWindowPointerMove);
|
||||||
window.removeEventListener("keydown", handleWindowKeyDown);
|
window.removeEventListener("keydown", handleWindowKeyDown);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user