Help! Mouse control outside of canvas..

BlitzPlus Forums/BlitzPlus Programming/Help! Mouse control outside of canvas..

norki: Uhm, uh, is this what you want to establish?
(hold down the mousebutton and drag the mouse in the canvas)
app=CreateWindow("bla",0,0,640,480)

canvas=CreateCanvas(32,32,128,128,app)


Repeat
	WaitEvent()
	If EventID()=$803 quit=True

	If EventSource()=canvas
		If EventID()=$201
			lmd=True
		EndIf
		If EventID()=$202
			lmd=True
		EndIf
		If lmd
			SetBuffer CanvasBuffer(canvas)
				x=EventX()
				y=EventY()
				cx=x
				cy=y

				If cx<0 cx=0
				If cy<0 cy=0
				If cx>127 cx=127
				If cy>127 cy=127

				Cls
				
				Color 255,255,255
				Rect cx-4,cy-4,9,9,False

				Text 32,32,"x: "+x
				Text 32,48,"y: "+y

				
			FlipCanvas canvas
		EndIf
	EndIf
	
Until quit
End