; ; AutoHotkey Version: 1.x ; Language: English ; Platform: Win9x/NT ; Author: Josh Nikkel & Noah Manneschmdt ; ; Script Function: ; Remaps a bit of the right analog stick on a 360 controller for use with aquaria (http://bit-blot.com/aquaria/) ; ; If you want to unconditionally use a specific joystick number, change ; the following value from 0 to the number of the joystick (1-32). ; A value of 0 causes the joystick number to be auto-detected: JoystickNumber = 0 ; END OF CONFIG SECTION. Do not make changes below this point unless ; you wish to alter the basic functionality of the script. ; Auto-detect the joystick number if called for: if JoystickNumber <= 0 { Loop 32 ; Query each joystick number to find out which ones exist. { GetKeyState, JoyName, %A_Index%JoyName if JoyName <> { JoystickNumber = %A_Index% break } } if JoystickNumber <= 0 { MsgBox The system does not appear to have any joysticks. ExitApp } } #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. loop{ getkeystate, joyr, %JoystickNumber%joyr if (joyr > 70) { send {wheeldown} sleep 100 } if (joyr < 30) { send {wheelup} sleep 100 } getkeystate, myjoy, %JoystickNumber%joy10 if myjoy = D gosub, strange } strange: send {mbutton down} keywait %JoystickNumber%joy10 send {mbutton up} return