eventloop for ploting devices
R_ProcessEvents only in interactive mode
fix indentation issue
R_ProcessEvents on demand only