Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- toggle := false
- isMirroring := false
- CoordMode, Mouse, Screen
- F1::
- toggle := !toggle
- ToolTip % toggle ? "Mirror Click ON" : "Mirror Click OFF"
- SetTimer, RemoveTip, -800
- return
- RemoveTip:
- ToolTip
- return
- #If toggle
- ~LButton::
- ; Prevent recursion
- if (isMirroring)
- return
- isMirroring := true
- ; Get original position
- MouseGetPos, x, y, hwnd
- ; Save original window
- origHWND := hwnd
- ; Optional: save original position
- origX := x
- origY := y
- sleep, 100
- ; Click to the right
- x := x + 800
- Click, %x%, %y%
- ; Optional: move mouse back (no click)
- MouseMove, %origX%, %origY%, 0
- ; Refocus original window
- if WinExist("ahk_id " origHWND)
- {
- WinRestore, ahk_id %origHWND%
- WinActivate, ahk_id %origHWND%
- }
- isMirroring := false
- return
- #If
- f2::exitapp
Advertisement
Add Comment
Please, Sign In to add comment