SHARE
TWEET

Untitled

a guest Aug 21st, 2019 87 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; Delay variable
  2.  
  3. delay := 200 ; delay in milliseconds (1000 milliseconds = 1 second)
  4.  
  5. Joy1:: ; Center cursor on LEFT (Sinistra) monitor of a two monitor arrangement
  6. Sleep, delay
  7. !s::
  8. coordMode, Mouse, Screen
  9. SysGet, mons, MonitorCount
  10. if (mons = 1 or mons > 2)
  11.  {
  12.   x := (A_ScreenWidth //2)
  13.   y := (A_ScreenHeight //2)
  14.   mouseMove, x, y
  15.   return
  16.  }
  17.  
  18. SysGet, Mon1, Monitor, 1
  19. Mon1Delx := Abs(Mon1Left - Mon1Right) // 2
  20. Mon1Dely := Abs(Mon1Top - Mon1Bottom) // 2
  21. Mon1Cx := (Mon1Left + Mon1Delx)
  22. Mon1Cy := (Mon1Top + Mon1Dely)
  23.  
  24. SysGet, Mon2, Monitor, 2
  25. Mon2Delx := Abs(Mon2Left - Mon2Right) // 2
  26. Mon2Dely := Abs(Mon2Top - Mon2Bottom) // 2
  27. Mon2Cx := (Mon2Left + Mon2Delx)
  28. Mon2Cy := (Mon2Top + Mon2Dely)
  29.  
  30. if (Mon1Left < Mon2Left)
  31.   mouseMove, Mon1Cx, Mon1Cy
  32. else
  33.   mouseMove, Mon2Cx, Mon2Cy
  34. return
  35.  
  36. ; Joy2: Left button
  37. Joy2::
  38. Send LButton
  39. return
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top