Use mouse_x and mouse_y to get the current coordinates of the mouse cursor.
Use pmouse_x() and pmouse_y() to get the previous coordinates of the mouse cursor.
mouse_moved
mouse_pressed
mouse_released
mouse_dragged
mouse_wheel
keyboard.key
keyboard.keyCode
key_pressed
key_released
Challenge: Modify the program to keep the text spinning until the left or right arrow key is released.