Advertisement
Guest User

mouselocktry3

a guest
May 28th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. f1:: ;on
  2. WinGetPos, VarX, VarY, Width, Height, A
  3. VarX2 := VarX + Width
  4. VarY2 := VarY + Height
  5. ClipCursor( True, VarX+80, VarY, VarX2-80, VarY2)
  6. Return
  7.  
  8. f2::ClipCursor( False,0,0,0,0) ;off
  9.  
  10. ClipCursor( Confine=True, x1=0 , y1=0, x2=1, y2=1 ) {
  11. VarSetCapacity(R,16,0), NumPut(x1,&R+0),NumPut(y1,&R+4),NumPut(x2,&R+8),NumPut(y2,&R+12)
  12. Return Confine ? DllCall( "ClipCursor", UInt,&R ) : DllCall( "ClipCursor" )
  13. }
  14.  
  15. #f1::
  16. {
  17. Send {f1 down}
  18. return
  19. }
  20.  
  21. ^f1::
  22. {
  23. Send {f1 up}
  24. return
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement