Guest User

Untitled

a guest
Sep 28th, 2021
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. #NoEnv
  2. SetBatchLines -1
  3. Process Priority,,R
  4.  
  5. BlockInput Mouse ; user mouse input is ignored during MouseMove
  6. CoordMode Mouse, Screen ; absolute coordinates
  7. SysGet m, Monitor ; get the screen edges
  8. mTop += 1, mBottom -= 2
  9. SetMouseDelay -1 ; fastest action
  10.  
  11. MButton::
  12. Click M Down
  13. MouseGetPos x0, y0 ; get initial mouse pointer location
  14. SetTimer WatchMouse, 1 ; run the subroutine fast (10..16ms)
  15. Return
  16.  
  17. MButton Up::
  18. Click M Up
  19. SetTimer WatchMouse, Off
  20. Return
  21.  
  22. WatchMouse:
  23. MouseGetPos x, y ; get current mouse position
  24. y0 += (y0-y), y0 := y0 < mTop ? mTop : (y0 > mBottom ? mBottom : y0)
  25. MouseMove x, y0, 0 ; set new position as old, for the next timer
  26. Return
Advertisement
Add Comment
Please, Sign In to add comment