This script is designed for the Nyko - Airflo PC but should be customizable for any Dual Analog Gamepad.
Avaliable Below
Avaliable Below
You might already know that things like the below can be simplified as "Send, m". In addition to performing a little better, there will be less delay because KeyDelay will be done only once:
Send, {m down}
Send, {m up}
If the speed at which keys are pushed down and released is important, this line near the top of the script will make things faster, though it might be too fast for the game to work reliably (especially if you use -1 vs. 0): SetKeyDelay, 0
If you want to make the script easier to reconfigure for a joystick other than the first, there is now a way to do that (I've been meaning to change the posted joystick script to do this too):
In the config section (to make it easier to configure):
joy1_key = z
In the auto-execute section:
Hotkey, %JoystickNumber%joy1, joy1
In the button section: you could replace the double colon with a single colon and make these other changes:
Joy1: ;Joystick Button 1
Send, {%joy1_key% down} ; Push and hold key
...
Send, {%joy1_key% up} ; Release key
Finally, because all variables are global, any time you have something like this:
GetKeyState, state, joy2
it's best to replace state with a unique variable name (e.g. state2). This avoids conflict/interference if you ever press down more than one button at a time.
; PC Keyboard / Mouse Bindings Script for Nyko - Airflow PC, and Dual Analog Controllers ; ; Version 0.4 Alpha - General Gaming Layout ; ; Since Nyko has no software avaliable to customize their controller I decided to ; create one of my own. ; ; Made Posssible by www.autohotkey.com ; ; This script converts the Nyko Airflow PC controller into a functional controller for ; most games. It is based off the mouse script located on authotkey's website. Although ; this script is specifically desgined for the Nyko - Airflo PC it may be used with any ; dual analog gamepad. ; ; -- Features -- ; (All # are imprinted on joystick buttons) ; These are my personal settings based off the Rainbow 6 layout (I use it ; on all my games) it may be screwy to you so modify the settings to your preference. ; ; Airflo PC Keyboard Gaming Standard ; ; Right Analog Joystick Mapped to Mouse Mouse Look ; Left Analog Joystick Mapped to WASD Standard Run/Strafe ; Button 1 Mapped to Z Reload ; Button 2 Mapped to Space Use ; Button 3 Mapped to F Rate of Fire ; Button 4 Mapped to X Lay Down ; Trigger 5 Mapped to Left Shift Duck ; Trigger 6 Mapped to Middle Mouse Jump ; Trigger 7 Mapped to Right Mouse Alt Fire ; Trigger 8 Mapped to Left Mouse Fire ; Select 9 Mapped to TAB Show Scores ; Select 10 Mapped to V Drop Weapon ; Select 11 Mapped to ESC Menu ; Left Analog Down 12 Mapped to Q Peek Left ; Right Analog Down 13 Mapped to E Peek Right ; Pad Up Mapped to N Zoom Map ; Pad Down Mapped to M Map ; Pad Left Mapped to WheelUp Next Weapon ; Pad Right Mapped to WheelDown Previous Weapon ; ; Special Binds ; CTRL F6 Mapped to Decrease Sensitivity ; CTRL F7 Mapped to Increase Sensitivity ; ; ---New in This Version--- ; Left analog stick jitter corrected. ; Buttons 2 and 3 now work properly. ; ; ---Coming Soon--- ; Easily customizable Keybinds ; ; ---STARTUP--- ; #SingleInstance SetBatchLines, 10ms SetKeyDelay, 0 ; ; ---USER CONFIGURATION--- ; ---USER CONFIGURATION--- ; ---USER CONFIGURATION--- ; ; ---Multiple Joystick Configuration--- ; If you have more than one Joystick, Increase this value to use a joystick other ; than the first (in which case you'll also need to change the Joy1:: and Joy2:: ; labels below) JoystickNumber = 1 ; ---Right Analog Stick Sensitivity--- ; Mouse Sensitivity, increase for more sensitive. JoyMultiplier = 0.30 ; ---Right Analog Stick Float--- ; Decrease this value to require less joystick displacement-from-center ; to start moving the mouse. However, you may need to calibrate your ; joystick -- ensuring it's properly centered -- to avoid cursor drift. ; The Airflo PC is usually pretty tight unless heavily weared. JoyThreshold = 1 ; ---Joystick Center Point---- JoyThresholdUpper = 50 JoyThresholdUpper += %JoyThreshold% JoyThresholdLower = 50 JoyThresholdLower -= %JoyThreshold% ; ---Mouse L/R Mapping--- ; Change these values to use button numbers other than 1 & 2 for the left & right ; mouse buttons, respectively (in which case you'll also need to change the Joy8:: ; and Joy7:: labels below, not recommended) ButtonLeft = 8 ButtonRight = 7 ; ---Joystick Key Mapping--- ; Since this is a work in progress not all features are avaliable yet. joy1bind = z joy2bind = Space joy3bind = f joy4bind = x joy5bind = lshift ; joy6bind = MOUSE MIDDLE CLICK (Requires Recoding or this Option is Not Currently Rebindable) ; joy7bind = MOUSE RIGHT CLICK (Requires Recoding or this Option is Not Currently Rebindable) ; joy8bind = MOUSE LEFT CLICK (Requires Recoding or this Option is Not Currently Rebindable) joy9bind = Tab joy10bind = v joy11bind = Esc joy12bind = q joy13bind = e lstickupbind = w lstickdownbind = s lstickleftbind = a lstickrightbind = d padupbind = l paddownbind = m ; padleftbind = MOUSE WHEEL UP (Requires Recoding or this Option is Not Currently Rebindable) ; padrightbind = MOUSE WHEEL DOWN (Requires Recoding or this Option is Not Currently Rebindable) ; ; ---END USER CONFIGURATION--- ; ---END USER CONFIGURATION--- ; ---END USER CONFIGURATION--- ; ; ; ---END STARTUP--- ; SetTimer, WatchJoystick, 10 return ; ; ---Sensitivity Controls--- ; ^F6:: if JoyMultiplier > 0 { JoyMultiplier -= 0.005 } return ^F7:: JoyMultiplier += 0.005 return ; ; ---BEGIN BUTTON CUSTOMIZATION--- ; ; Add a prefix to each of the below hotkeys to use a joystick other ; than the first. For example: 2Joy1 is the second joystick's first ; mouse button. Joy1:: ;Joystick Button 1 Send, {z down} ; Push and hold Z key Loop { Sleep, 10 ;Check Every 10 ms GetKeyState, joy1state, joy1 ; Is key up or down? if joy1state = U ; The button has been released, so break out of the loop. break } Send, {z up} ; Release Z key return Joy2:: Send, {Space down} Loop { Sleep, 10 GetKeyState, joy2state, joy2 if joy2state = U break } Send, {Space up} return Joy3:: Send, {f down} Loop { Sleep, 10 GetKeyState, joy3state, joy3 if joy3state = U break } Send, {f up} return Joy4:: Send, {x down} Loop { Sleep, 10 GetKeyState, joy4state, joy4 if joy4state = U break } Send, {x up} return Joy5:: Send, {shiftdown} Loop { Sleep, 10 GetKeyState, joy5state, joy5 if joy5state = U break } Send, {shiftup} return Joy6:: MouseClick, Middle, , , 1, ,D Loop { Sleep, 10 GetKeyState, joy6state, joy6 if joy6state = U break } MouseClick, Middle, , , , ,U return Joy7:: SetMouseDelay, -1 ; Makes movement smoother. MouseClick, right, , , 1, 0, D ; Hold down the right mouse button. SetTimer, WaitForRightButtonUp, 10 return Joy8:: SetMouseDelay, -1 ; Makes movement smoother. MouseClick, left, , , 1, 0, D ; Hold down the left mouse button. SetTimer, WaitForLeftButtonUp, 10 return joy9:: Send, {Tab down} Loop { Sleep, 10 GetKeyState, joy9state, joy9 if joy9state = U break } Send, {Tab up} return joy10:: Send, {v down} Loop { Sleep, 10 GetKeyState, joy10state, joy10 if joy10state = U break } Send, {v up} return joy11:: Send, {Esc down} Loop { Sleep, 10 GetKeyState, joy11state, joy11 if joy11state = U break } Send, {Esc up} return joy12:: Send, {q down} Loop { Sleep, 10 GetKeyState, joy12state, joy12 if joy12state = U break } Send, {q up} return joy13:: Send, {e down} Loop { Sleep, 10 GetKeyState, joy13state, joy13 if joy13state = U break } Send, {e up} return ; ; ---CHECK BUTTON STATES--- ; WaitForLeftButtonUp: GetKeyState, jstate1, %JoystickNumber%Joy%ButtonLeft% if jstate1 = D ; The button is still, down, so keep waiting. return ; Otherwise, the button has been released. SetTimer, WaitForLeftButtonUp, off SetMouseDelay, -1 ; Makes movement smoother. MouseClick, left, , , 1, 0, U ; Release the mouse button. return WaitForRightButtonUp: GetKeyState, jstate2, %JoystickNumber%Joy%ButtonRight% if jstate2 = D return ; Otherwise, the button has been released. SetTimer, WaitForRightButtonUp, off MouseClick, right, , , 1, 0, U return ; ; ---BEGIN JOYSTICK WATCH--- ; WatchJoystick: MoveMouse? = n MoveStick? = n SetFormat, float, 03 GetKeyState, joyx, %JoystickNumber%joyx GetKeyState, joyy, %JoystickNumber%joyy GetKeyState, joyr, %JoystickNumber%joyr GetKeyState, joyz, %JoystickNumber%joyz GetKeyState, joypov, %JoystickNumber%joypov ; ; --- RIGHT ANALOG JOYSTICK CONTROL ---- ; if joyr > %JoyThresholdUpper% { MoveMouse? = y DeltaR = %joyr% DeltaR -= %JoyThresholdUpper% } else if joyr < %JoyThresholdLower% { MoveMouse? = y DeltaR = %joyr% DeltaR -= %JoyThresholdLower% } else DeltaR = 0 if joyz > %JoyThresholdUpper% { MoveMouse? = y DeltaZ = %joyz% DeltaZ -= %JoyThresholdUpper% } else if joyz < %JoyThresholdLower% { MoveMouse? = y DeltaZ = %joyz% DeltaZ -= %JoyThresholdLower% } else DeltaZ = 0 if MoveMouse? = y { DeltaR *= %JoyMultiplier% DeltaZ *= %JoyMultiplier% SetMouseDelay, -1 ; Makes movement smoother. MouseMove, %DeltaR%, %DeltaZ%, 0, R } ; ; --- LEFT ANALOG JOYSTICK CONTROL --- ; if joyX > %JoyThresholdUpper% { MoveStick? = y DeltaX = %joyX% DeltaX -= %JoyThresholdUpper% } else if joyX < %JoyThresholdLower% { MoveStick? = y DeltaX = %joyX% DeltaX -= %JoyThresholdLower% } else DeltaX = 0 if joyY > %JoyThresholdUpper% { MoveStick? = y DeltaY = %joyY% DeltaY -= %JoyThresholdUpper% } else if joyY < %JoyThresholdLower% { MoveStick? = y DeltaY = %joyY% DeltaY -= %JoyThresholdLower% } else DeltaY = 0 if MoveStick? = y { DeltaX *= %JoyMultiplier% DeltaY *= %JoyMultiplier% if DeltaX < 0 { GetKeyState, astate, a if astate = U { Send, {a down} } GetKeyState, dstate, d if dstate = D { Send, {d up} } } else if DeltaX > 0 { GetKeyState, dstate, d if dstate = U { Send, {d down} } GetKeyState, astate, a if astate = D { Send, {a up} } } if DeltaY < 0 { GetKeyState, wstate, w if wstate = U { Send, {w down} } GetKeyState, sstate, s if sstate = D { Send, {s up} } } else if DeltaY > 0 { GetKeyState, sstate, s if sstate = U { Send, {s down} } GetKeyState, wstate, w if wstate = D { Send, {w up} } } } if DeltaY = 0 { GetKeyState, wstate, w GetKeyState, sstate, s if wstate = D { Send, {w up} } if sstate = D { Send, {s up} } } if DeltaX = 0 { GetKeyState, astate, a GetKeyState, dstate, d if astate = D { Send, {a up} } else if dstate = D { Send, {d up} } } ; ; ---CONFIGURE DIRECTIONAL PAD--- ; if joypov = 0 { Send, l return } if joypov = 9000 { sleep, 500 MouseClick, WheelDown, , , 1 return } if joypov = 18000 { Send, m return } if joypov = 27000 { sleep, 500 MouseClick, WheelUp, , , 1 return }
SetKeyDelay, 0 JoystickNumber = 1 SetTimer, WatchJoystick, 0 WatchJoystick: GetKeyState, joypov, %JoystickNumber%JoyPOV if joypov = 0 Send, {w down} if joypov = 9000 Send, {d down} if joypov = 18000 Send, {s down} if joypov = 27000 Send, {a down} joy5:: send ebut there are two serious problems with it. One, I had to write a bogus auto hot key "joy5::send e" just to keep the script from exiting automatically. I tried the #Persistence command, but it didnt work. What command should I use to keep the program from exiting?
if joypov = 0 Send, {w down} Loop { Sleep, 10 GetKeyState, joypov, joyPOV if joypov = -1 ; The button has been released, so break out of the loop. break } Send, {w up} returnbut this doesnt seem to work. Any ideas on what I am doing wrong? Thanks in advance!!!
The directive is #persistent. I tested your script with that and it didn't exit. However, to get in the right habit, you should also have a Return at the end of every subroutine. In addition, you should probably have a Return in the spot indicated below, otherwise the execution will fall right through into the subroutine:I had to write a bogus auto hot key "joy5::send e" just to keep the script from exiting automatically. I tried the #Persistence command, but it didnt work. What command should I use to keep the program from exiting?
If you don't need the key to be held down for use with the game, use something like "Send s" rather than "Send {s down}". If you do need the key to be held down during the entire time you're holding the POV axis in a certain direction, you'll need something more complex (simlar to the example you posted). If this is the case, post a few more details and we'll try to help.this script works fine in Notepad when i tested it, but when I used it for the application (zsnes), the keys never "auto up" like they do when tested in Notepad. The application thinks I am never letting go of the d-pad.
#persistent SetKeyDelay, 0 JoystickNumber = 1 SetTimer, WatchJoystick, 0 return WatchJoystick: GetKeyState, joypov, %JoystickNumber%JoyPOV if joypov = 0 Send, {w down}{a up}{d up}{s up} if joypov = 4500 Send, {w down}{d down}{a up}{s up} if joypov = 9000 Send, {d down}{w up}{s up}{a up} if joypov = 13500 Send, {d down}{s down}{a up}{w up} if joypov = 18000 Send, {s down}{a up}{d up}{w up} if joypov = 22500 Send, {s down}{a down}{w up}{d up} if joypov = 27000 Send, {a down}{w up}{s up}{d up} if joypov = 31500 Send, {a down}{w down}{d up}{s up} if joypov = -1 Send, {w up}{d up}{a up}{s up} returnIt's ugly, but it works! If you want to turn the d pad into 4 buttons (like the yellow c buttons on the N64 controller) delete the commands for the diagonals (ie 4500, 13500, 22500, and 31500). Thanks for the awesome program!!!!!
;button 1 to F1 *Joy1:: Send, {F1 down} KeyWait, Joy1 Send, {F1 up}
; PC Keyboard / Mouse Bindings Script for Nyko - Airflow PC, and Dual Analog Controllers ; ; Version 0.4 Alpha - General Gaming Layout ; ; Since Nyko has no software avaliable to customize their controller I decided to ; create one of my own. ; ; Made Posssible by www.autohotkey.com ; ; This script converts the Nyko Airflow PC controller into a functional controller for ; most games. It is based off the mouse script located on authotkey's website. Although ; this script is specifically desgined for the Nyko - Airflo PC it may be used with any ; dual analog gamepad. ; ; -- Features -- ; (All # are imprinted on joystick buttons) ; These are my personal settings based off the Rainbow 6 layout (I use it ; on all my games) it may be screwy to you so modify the settings to your preference. ; ; Airflo PC Keyboard Gaming Standard ; ; Right Analog Joystick Mapped to Mouse Mouse Look ; Left Analog Joystick Mapped to WASD Standard Run/Strafe ; Button 1 Mapped to Z Reload ; Button 2 Mapped to Space Use ; Button 3 Mapped to F Rate of Fire ; Button 4 Mapped to X Lay Down ; Trigger 5 Mapped to Left Shift Duck ; Trigger 6 Mapped to Middle Mouse Jump ; Trigger 7 Mapped to Right Mouse Alt Fire ; Trigger 8 Mapped to Left Mouse Fire ; Select 9 Mapped to TAB Show Scores ; Select 10 Mapped to V Drop Weapon ; Select 11 Mapped to ESC Menu ; Left Analog Down 12 Mapped to Q Peek Left ; Right Analog Down 13 Mapped to E Peek Right ; Pad Up Mapped to N Zoom Map ; Pad Down Mapped to M Map ; Pad Left Mapped to WheelUp Next Weapon ; Pad Right Mapped to WheelDown Previous Weapon ; ; Special Binds ; CTRL F6 Mapped to Decrease Sensitivity ; CTRL F7 Mapped to Increase Sensitivity ; ; ---New in This Version--- ; Left analog stick jitter corrected. ; Buttons 2 and 3 now work properly. ; ; ---Coming Soon--- ; Easily customizable Keybinds ; ; ---STARTUP--- ; #SingleInstance SetBatchLines, 10ms SetKeyDelay, 0 ; ; ---USER CONFIGURATION--- ; ---USER CONFIGURATION--- ; ---USER CONFIGURATION--- ; ; ---Multiple Joystick Configuration--- ; If you have more than one Joystick, Increase this value to use a joystick other ; than the first (in which case you'll also need to change the Joy1:: and Joy2:: ; labels below) JoystickNumber = 1 ; ---Left Analog Stick Sensitivity--- ; Mouse Sensitivity, increase for more sensitive. JoyMultiplier = 0.30 ; ---Left Analog Stick Float--- ; Decrease this value to require less joystick displacement-from-center ; to start moving the mouse. However, you may need to calibrate your ; joystick -- ensuring it's properly centered -- to avoid cursor drift. ; The Airflo PC is usually pretty tight unless heavily weared. JoyThreshold = 1 ; ---Joystick Center Point---- JoyThresholdUpper = 50 JoyThresholdUpper += %JoyThreshold% JoyThresholdLower = 50 JoyThresholdLower -= %JoyThreshold% ; ---Mouse L/R Mapping--- ; Change these values to use button numbers other than 1 & 2 for the left & right ; mouse buttons, respectively (in which case you'll also need to change the Joy8:: ; and Joy7:: labels below, not recommended) ButtonLeft = 8 ButtonRight = 7 ; ---Joystick Key Mapping--- ; Since this is a work in progress not all features are avaliable yet. joy1bind = z joy2bind = Space joy3bind = f joy4bind = x joy5bind = lshift ; joy6bind = MOUSE MIDDLE CLICK (Requires Recoding or this Option is Not Currently Rebindable) ; joy7bind = MOUSE RIGHT CLICK (Requires Recoding or this Option is Not Currently Rebindable) ; joy8bind = MOUSE LEFT CLICK (Requires Recoding or this Option is Not Currently Rebindable) joy9bind = Tab joy10bind = v joy11bind = Esc joy12bind = q joy13bind = e lstickupbind = w lstickdownbind = s lstickleftbind = a lstickrightbind = d padupbind = l paddownbind = m ; padleftbind = MOUSE WHEEL UP (Requires Recoding or this Option is Not Currently Rebindable) ; padrightbind = MOUSE WHEEL DOWN (Requires Recoding or this Option is Not Currently Rebindable) ; ; ---END USER CONFIGURATION--- ; ---END USER CONFIGURATION--- ; ---END USER CONFIGURATION--- ; ; ; ---END STARTUP--- ; SetTimer, WatchJoystick, 10 return ; ; ---Sensitivity Controls--- ; ^F6:: if JoyMultiplier > 0 { JoyMultiplier -= 0.005 } return ^F7:: JoyMultiplier += 0.005 return ; ; ---BEGIN BUTTON CUSTOMIZATION--- ; ; Add a prefix to each of the below hotkeys to use a joystick other ; than the first. For example: 2Joy1 is the second joystick's first ; mouse button. Joy1:: ;Joystick Button 1 Send, {z down} ; Push and hold Z key Loop { Sleep, 10 ;Check Every 10 ms GetKeyState, joy1state, joy1 ; Is key up or down? if joy1state = U ; The button has been released, so break out of the loop. break } Send, {z up} ; Release Z key return Joy2:: Send, {Space down} Loop { Sleep, 10 GetKeyState, joy2state, joy2 if joy2state = U break } Send, {Space up} return Joy3:: Send, {f down} Loop { Sleep, 10 GetKeyState, joy3state, joy3 if joy3state = U break } Send, {f up} return Joy4:: Send, {x down} Loop { Sleep, 10 GetKeyState, joy4state, joy4 if joy4state = U break } Send, {x up} return Joy5:: Send, {shiftdown} Loop { Sleep, 10 GetKeyState, joy5state, joy5 if joy5state = U break } Send, {shiftup} return Joy6:: MouseClick, Middle, , , 1, ,D Loop { Sleep, 10 GetKeyState, joy6state, joy6 if joy6state = U break } MouseClick, Middle, , , , ,U return Joy7:: SetMouseDelay, -1 ; Makes movement smoother. MouseClick, right, , , 1, 0, D ; Hold down the right mouse button. SetTimer, WaitForRightButtonUp, 10 return Joy8:: SetMouseDelay, -1 ; Makes movement smoother. MouseClick, left, , , 1, 0, D ; Hold down the left mouse button. SetTimer, WaitForLeftButtonUp, 10 return joy9:: Send, {Tab down} Loop { Sleep, 10 GetKeyState, joy9state, joy9 if joy9state = U break } Send, {Tab up} return joy10:: Send, {v down} Loop { Sleep, 10 GetKeyState, joy10state, joy10 if joy10state = U break } Send, {v up} return joy11:: Send, {Esc down} Loop { Sleep, 10 GetKeyState, joy11state, joy11 if joy11state = U break } Send, {Esc up} return joy12:: Send, {q down} Loop { Sleep, 10 GetKeyState, joy12state, joy12 if joy12state = U break } Send, {q up} return joy13:: Send, {e down} Loop { Sleep, 10 GetKeyState, joy13state, joy13 if joy13state = U break } Send, {e up} return ; ; ---CHECK BUTTON STATES--- ; WaitForLeftButtonUp: GetKeyState, jstate1, %JoystickNumber%Joy%ButtonLeft% if jstate1 = D ; The button is still, down, so keep waiting. return ; Otherwise, the button has been released. SetTimer, WaitForLeftButtonUp, off SetMouseDelay, -1 ; Makes movement smoother. MouseClick, left, , , 1, 0, U ; Release the mouse button. return WaitForRightButtonUp: GetKeyState, jstate2, %JoystickNumber%Joy%ButtonRight% if jstate2 = D return ; Otherwise, the button has been released. SetTimer, WaitForRightButtonUp, off MouseClick, right, , , 1, 0, U return ; ; ---BEGIN JOYSTICK WATCH--- ; WatchJoystick: MoveMouse? = n MoveStick? = n SetFormat, float, 03 GetKeyState, joyx, %JoystickNumber%joyx GetKeyState, joyy, %JoystickNumber%joyy GetKeyState, joyr, %JoystickNumber%joyr GetKeyState, joyz, %JoystickNumber%joyz GetKeyState, joypov, %JoystickNumber%joypov ; ; --- Left ANALOG JOYSTICK CONTROL ---- ; if joyx > %JoyThresholdUpper% { MoveMouse? = y DeltaR = %joyx% DeltaR -= %JoyThresholdUpper% } else if joyx < %JoyThresholdLower% { MoveMouse? = y DeltaR = %joyx% DeltaR -= %JoyThresholdLower% } else DeltaR = 0 if joyy > %JoyThresholdUpper% { MoveMouse? = y DeltaZ = %joyy% DeltaZ -= %JoyThresholdUpper% } else if joyy < %JoyThresholdLower% { MoveMouse? = y DeltaZ = %joyy% DeltaZ -= %JoyThresholdLower% } else DeltaZ = 0 if MoveMouse? = y { DeltaR *= %JoyMultiplier% DeltaZ *= %JoyMultiplier% SetMouseDelay, -1 ; Makes movement smoother. MouseMove, %DeltaR%, %DeltaZ%, 0, R } ; ; --- Right ANALOG JOYSTICK CONTROL --- ; if joyr > %JoyThresholdUpper% { MoveStick? = y DeltaX = %joyr% DeltaX -= %JoyThresholdUpper% } else if joyr < %JoyThresholdLower% { MoveStick? = y DeltaX = %joyr% DeltaX -= %JoyThresholdLower% } else DeltaX = 0 if joyz > %JoyThresholdUpper% { MoveStick? = y DeltaY = %joyz% DeltaY -= %JoyThresholdUpper% } else if joyz < %JoyThresholdLower% { MoveStick? = y DeltaY = %joyz% DeltaY -= %JoyThresholdLower% } else DeltaY = 0
;; THIS IS THE AREA WITH THE ISSUE ;; if MoveStick? = y { DeltaX *= %JoyMultiplier% DeltaY *= %JoyMultiplier% if Deltay < 0 { GetKeyState, astate, a if astate = U { Send, {left down} ; follow with {left up} - works but choppy return } GetKeyState, dstate, d if dstate = D { Send, {right up} ; doent work return } } else if Deltay > 0 { GetKeyState, dstate, d if dstate = U { Send, {right down} return } GetKeyState, astate, a if astate = D { Send, {left up} return } } if Deltax < 0 { GetKeyState, wstate, w if wstate = U { Send, {up down} return } GetKeyState, sstate, s if sstate = D { Send, {down up} return } } else if Deltax > 0 { GetKeyState, sstate, s if sstate = U { Send, {down down} return } GetKeyState, wstate, w if wstate = D { Send, {up up} return } } } if Deltax = 0 { GetKeyState, wstate, w GetKeyState, sstate, s if wstate = D { Send, {up up} return } if sstate = D { Send, {down up} return } } if Deltay = 0 { GetKeyState, astate, a GetKeyState, dstate, d if astate = D { Send, {left up} return } else if dstate = D { Send, {right up} return } }
; ; ---CONFIGURE DIRECTIONAL PAD--- ; if joypov = 0 Send, {w down}{a up}{d up}{s up} if joypov = 4500 Send, {w down}{d down}{a up}{s up} if joypov = 9000 Send, {d down}{w up}{s up}{a up} if joypov = 13500 Send, {d down}{s down}{a up}{w up} if joypov = 18000 Send, {s down}{a up}{d up}{w up} if joypov = 22500 Send, {s down}{a down}{w up}{d up} if joypov = 27000 Send, {a down}{w up}{s up}{d up} if joypov = 31500 Send, {a down}{w down}{d up}{s up} if joypov = -1 Send, {w up}{d up}{a up}{s up} return