Sometimes the way to stop it is to unplug the mouse (if one is attached), or wait for it to settle down at the bottom left corner of the screen.
This happens regardless if I am using a mouse or the touchpad. The mouse arrow would for no apparent reason, begin moving diagonally from the right of the screen to the bottom left. Lately I've been having this weird problem.