Actually, you need to update the mouse_pos frequently :
which means put them inside a loop.

Look at the example from the mighty Manual->mouse_cursor.