Advertisement
congdantoancau

Toggle move mouse to center of the screen

Sep 18th, 2018
389
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; Toggle move mouse to center of screen
  2. F13::
  3.     lastX := curX, lastY := curY
  4.     MouseGetPos, curX, curY
  5.     cenX := A_ScreenWidth/2
  6.     cenY := A_ScreenHeight/2
  7.     if (curX == cenX and curY == cenY)
  8.     {
  9.         tarX := lastX, tarY := lastY
  10.     }
  11.     else
  12.     {
  13.         tarX := cenX, tarY := cenY
  14.     }
  15.     MouseMove, tarX, tarY
  16. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement