Disable mouse move function

Hey guys!

I have a scene that contains a model , when the mouse move the scene moves also because I have a mouse move function .

In the same scene I have a button when I click on it the same scene stay but the position of the camera changed and I added orbit controls.

But here is the problem!!

Orbit controls and mouse move don’t work together

I didn’t found how I disble mouse move function when I click on the button.

How can i solve that plz!

You could:

a) remove the mousemove event listener when you click on the button and the listener at a later point again.
b) maintain a new boolean variable (e.g. enableMouseMove) that controls an early out of the mousemove event listener. If set to true, you immediately return from the event listener. In this case, you only have to set the correct boolean value in your app.