Camera follow mouse on zoom

Hello, I´m new to Gdevelop.
I made a button to switch zoom in and out the camera, now I want to be able to properly control the camera movement by mouse when the camera is zoomed in. To do that, I made an event with the action “Change the X position of camera set to MouseX()”, and the same for the Y, and yes, the camera follows the mouse, but the problem is that for some reason the camera keeps scrolling towards the direction that the mouse is positioned even if i´m not moving the mouse.
The thing I want to do is this:
When the camera is zoomed in and then I move the mouse, move the camera exactly like the mouse, and when the mouse stops, the camera stops too.

Thankyou in advance.

To check if the mouse is moving, you can store its position in variables and compare the stored values with the current values (the compare event should come before, in your events sheet, so as to execute on the next cycle)