; MoveMouse Example ; ----------------- Graphics 640,480,0,2 SetBuffer BackBuffer() ; Varied warp positions each run SeedRnd MilliSecs() While Not KeyDown(1) Cls ; MoveMouse teleports the pointer to the given screen position - ; MouseX/MouseY immediately report the new location. If KeyHit(57) Then MoveMouse Rand(20,619),Rand(60,459) ; Space: random warp If MouseHit(1) Then MoveMouse 320,240 ; left click: re-centre ; Centre marker (the re-centre target) Color 90,90,90 Line 310,240,330,240 Line 320,230,320,250 ; Marker at the (possibly warped) pointer position Color 255,255,0 Oval MouseX()-6,MouseY()-6,12,12,False Color 255,255,255 Text 0,0,"Space: warp pointer to a random spot Left click: MoveMouse 320,240 Esc: exit" Text 0,20,"MouseX()="+MouseX()+" MouseY()="+MouseY() Flip Wend End