tabnation

mouse mirror click two spots

Feb 7th, 2026
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. toggle := false
  2. isMirroring := false
  3.  
  4. CoordMode, Mouse, Screen
  5.  
  6. F1::
  7. toggle := !toggle
  8. ToolTip % toggle ? "Mirror Click ON" : "Mirror Click OFF"
  9. SetTimer, RemoveTip, -800
  10. return
  11.  
  12. RemoveTip:
  13. ToolTip
  14. return
  15.  
  16. #If toggle
  17. ~LButton::
  18. ; Prevent recursion
  19. if (isMirroring)
  20. return
  21.  
  22. isMirroring := true
  23.  
  24. ; Get original position
  25. MouseGetPos, x, y, hwnd
  26.  
  27. ; Save original window
  28. origHWND := hwnd
  29.  
  30.  
  31. ; Optional: save original position
  32. origX := x
  33. origY := y
  34. sleep, 100
  35. ; Click to the right
  36. x := x + 800
  37. Click, %x%, %y%
  38.  
  39. ; Optional: move mouse back (no click)
  40. MouseMove, %origX%, %origY%, 0
  41.  
  42. ; Refocus original window
  43. if WinExist("ahk_id " origHWND)
  44. {
  45. WinRestore, ahk_id %origHWND%
  46. WinActivate, ahk_id %origHWND%
  47. }
  48.  
  49. isMirroring := false
  50. return
  51. #If
  52.  
  53.  
  54.  
  55.  
  56. f2::exitapp
Advertisement
Add Comment
Please, Sign In to add comment