; ; AutoHotkey Version: 1.x ; Language: English ; Platform: Win9x/NT ; ; Description: ; 1. Press Joystick 6 button "Joy Button 5" to Spot ; #SingleInstance force #InstallKeybdHook ; ; Only run this script when BF2.exe is running in the foreground ; SetTimer, KeepRunning return KeepRunning: ; Get the process name of the active window (i.e. Notepad.exe) WinGet, szProcessName, ProcessName, A if szProcessName = BF2.exe { Suspend, off } else { Suspend, on } return $^CapsLock:: ExitApp return ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Pressing the Joy6 button will spot ; $Joy6:: Send, {q Down} Sleep 100 MouseClick, Left, , , , , D sleep 40 MouseClick, Left, , , , , U Send, {q Up} return
To determine which joystick button to set goto Start -> Control Panel -> Game Controllers. Then goto properties for your joystick and press the appropriate button.
Joy6 is actually "Joy Button 5" when inside BF2 (Battlefield 2 starts counting from 0 rather than the ordinal method that AutoHotKey uses).
EDIT: Updated to use default keybinds (press 'q' to open the cammo rose).
Or you can run this script to test your joystick:
http://www.autohotke...oystickTest.htm