How could I keep my mouse pointer inside a canvas or window?

BlitzPlus Forums/BlitzPlus Programming/How could I keep my mouse pointer inside a canvas or window?

Make a "user32.dll" userlib. There is an API call to confine the mouse cursor region:

ClipCursor% ( Rect* )

Type Rect
    Field left
    Field right
    Field top
    Field bottom
End Type


But if you do this, MAKE SURE that you set the cursor's clip region back to the screen size again, so that other appilcations can use the mouse. And when you close your Blitz app, the cursor's clip region does not automatically get reset. So beware.