Is there any on mouse code that causes animated objects to move

(of course there is I just don’t know it)
I want an object to move slowly or quickly out of the mouse’s way depending on how the user moves the mouse.