f1:: ;on WinGetPos, VarX, VarY, Width, Height, A VarX2 := VarX + Width VarY2 := VarY + Height ClipCursor( True, VarX, VarY, VarX2, VarY2) Return f2::ClipCursor( False,0,0,0,0) ;off
If your playing windowed then this script will clip the border and title bar too
f1:: ;on WinGetPos, VarX, VarY, Width, Height, A Varx := VarX + 10 Vary := VarY + 30 VarX2 := VarX + Width - 20 ;10 + 10 VarY2 := VarY + Height - 40 ;30 + 10 ClipCursor( True, VarX, VarY, VarX2, VarY2) Return
you need the function too
ClipCursor( Confine=True, x1=0 , y1=0, x2=1, y2=1 ) { VarSetCapacity(R,16,0), NumPut(x1,&R+0),NumPut(y1,&R+4),NumPut(x2,&R+8),NumPut(y2,&R+12) Return Confine ? DllCall( "ClipCursor", UInt,&R ) : DllCall( "ClipCursor" ) }
To interested veterans, it seems no-one noticed that the first two coords are the top left of the box and the next two are the bottom left. [in clipcursor function[
i saw the screenheight thing and i only thought you could block per axis and not in boxes, good thing i guessed and got it right. Whoever made the function is a clever guy =]