Here you go....
Graphics 640,480 SetBuffer BackBuffer() x=GraphicsWidth()/2 y=GraphicsHeight()/2 Repeat Cls xs=MouseXSpeed() ys=MouseYSpeed() MoveMouse GraphicsWidth()/2,GraphicsHeight()/2 If mouseon x=x+xs y=y+ys EndIf Text x,y,"X",True,True If mouseon Then Text GraphicsWidth()/2,0,"Space to disable mouse",True:If KeyHit(57) Then mouseon=False If mouseon=False Then Text GraphicsWidth()/2,0,"Space to enable mouse",True:If KeyHit(57) Then mouseon=True Flip Until KeyHit(1)