Created
October 7, 2021 02:32
Star
You must be signed in to star a gist
XBox Controller autohotkey script to close or activate the active window (handy with games)
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
#SingleInstance Ignore | |
while (true) | |
{ | |
;back + start -> quit active window | |
if ((getKeyState("joy7") && getKeyState("Joy8")) || (getKeyState("2joy7") && getKeyState("2Joy8")) || (getKeyState("3joy7") && getKeyState("3Joy8"))) | |
{ | |
WinClose A | |
sleep 900 | |
} | |
;back + right stick click -> send esc | |
if ((getKeyState("joy7") && getKeyState("Joy10")) || (getKeyState("2joy7") && getKeyState("2Joy10")) || (getKeyState("3joy7") && getKeyState("3Joy10"))) | |
{ | |
Send, !{Esc} | |
} | |
;back + left stick click -> mouse click in middle of the active window | |
if ((getKeyState("joy7") && getKeyState("Joy9")) || (getKeyState("2joy9") && getKeyState("2Joy9")) || (getKeyState("3joy9") && getKeyState("3Joy9"))) | |
{ | |
;get window size and click on half position of window | |
CoordMode, Click, Window | |
WinGetPos, winX, winY, winWidth, winHeight, A | |
X := winWidth * 0.5 | |
Y := winHeight * 0.5 | |
Click %X% %Y% | |
;hacky way to move mouse to lowerright corner | |
MouseMove, 4000, 4000 | |
} | |
sleep 100 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment