Last active
November 14, 2023 13:56
-
-
Save dbdness/eb8480192270a08a0169a0e0599b69bd to your computer and use it in GitHub Desktop.
AutoHotKey script for bringing the cursor back to last known position (for example on main, external monitor) after touch event on occurs on another display (for example on sidecar laptop with touch screen).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;~Check mouse position every second. | |
SetTimer, MousePos, 1000 | |
MousePos: | |
MouseGetPos, x, y | |
return | |
~LButton:: | |
TimeL := A_TickCount | |
Return | |
~LButton Up:: | |
Time := A_TickCount - TimeL | |
xp := x + Abs(x)+1 + (1920 - Abs(x)) | |
If (Time < 20){ | |
if (x < 0){ | |
MouseMove, %xp%, %y% | |
} else { | |
MouseMove, %x%, %y% | |
} | |
} | |
Return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
All credits for first edition of the script goes to https://superuser.com/a/1779188.