Created
January 25, 2019 22:35
-
-
Save lmorchard/e74cfaeee671ce32efdc995ef310dd2f to your computer and use it in GitHub Desktop.
Mouse tracking AutoHotKey script
This file contains 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
; Key on mouse region change | |
!^+v:: | |
ToolTip, start | |
SetTimer, CheckMouseRegion, 2000 | |
return | |
!^+b:: | |
ToolTip, stop | |
SetTimer, CheckMouseRegion, off | |
return | |
CheckMouseRegion: | |
CoordMode, Mouse, Screen | |
SysGet mon, Monitor | |
MouseGetPos, xpos, ypos | |
if (xpos >= monRight or ypos >= monBottom) { | |
return | |
} | |
isLeft := xpos < (monRight / 2) | |
isUpper := ypos < (monBottom / 2) | |
isCenter := xpos > (monRight * 0.3) and xpos < (monRight * 0.6) and ypos > (monBottom * 0.3) and ypos < (monBottom * 0.6) | |
if (isLeft = wasLeft) and (isUpper = wasUpper) and (isCenter == wasCenter) { | |
return | |
} | |
;if (isCenter) { | |
; ControlSend, ,{Numpad5}, ahk_exe obs64.exe | |
;} else | |
if (isLeft and isUpper) { | |
ControlSend, ,{Numpad7}, ahk_exe obs64.exe | |
} else if (not isLeft and isUpper) { | |
ControlSend, ,{Numpad9}, ahk_exe obs64.exe | |
} else if (isLeft and not isUpper) { | |
ControlSend, ,{Numpad1}, ahk_exe obs64.exe | |
} else if (not isLeft and not isUpper) { | |
ControlSend, ,{Numpad3}, ahk_exe obs64.exe | |
} | |
wasLeft := isLeft | |
wasUpper := isUpper | |
wasCenter := isCenter | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment