Polled Input() with max gui?

BlitzMax Forums/BlitzMax Programming/Polled Input() with max gui?

Seems to work here:
Strict

Local win:TGadget = CreateWindow( "", 200,0, 400,300)
Local can:TGadget = CreateCanvas( 0,0, 400,300, win)
Local mX, mY, oldX, oldY

EnablePolledInput()
Repeat
	mX = MouseX()
	my = MouseY()
	If ( mX <> oldX ) Or ( mY <> oldY ) Then
		Print mX + ", " + mY
		oldX = mX
		oldY = mY
	EndIf
	If MouseHit(1) Then Print "MOUSE HIT"
Until KeyHit(KEY_ESCAPE)