Programmatically Moving the Mouse?

BlitzMax Forums/BlitzMax Programming/Programmatically Moving the Mouse?

UnderwoodNullium(Posted 2009) [#1]
I need a way to re-position the mouse back to the center of the screen. What is the best way to do this?

Thanks!


therevills(Posted 2009) [#2]
Try this:

SuperStrict

Const screenWidth%=640
Const screenHeight%=480

Graphics screenWidth,screenHeight,0

While Not AppTerminate()
	Cls
		If KeyHit(KEY_SPACE)
			MoveMouse(screenWidth/2,screenHeight/2)
		EndIf
		DrawText MouseX(), 10, 10
		DrawText MouseY(), 10, 20
	Flip
Wend




UnderwoodNullium(Posted 2009) [#3]
Wow I didn't know it was so easy. Thank you so much.