#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. ;#Warn ; Enable warnings to assist with detecting common errors. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. ;This script will activate your game window whenever ;any joystick axis changes. Handy for when you're ;Alt-Tabbed out of the game on your second monitor. SetFormat, float, 03 ;remove decimals from joystick values Loop { if WinExist("ahk_exe EliteDangerous64.exe") { IfWinNotActive { Loop { ;get axis values GetKeyState, joyY, 1JoyY GetKeyState, joyX, 1JoyX ;if any axis changes, activate game window ;joystick 'rests' at 50 if joyX not between 40 and 60 { WinActivate break } if joyY not between 40 and 60 { WinActivate break } if !WinExist("ahk_exe EliteDangerous64.exe") { break } } } } }