Move the mouse event handling to the input switch, move the autopilot variable to be switched in the automove function