Advertisement
alexdubovyck

Руль+педальки для WoW

Mar 1st, 2018
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. #Persistent ; Keep this script running until the user explicitly exits it.
  2. SetTimer, WatchAxis, 5
  3. return
  4.  
  5. WatchAxis:
  6. ; GetKeyState, JoyX, JoyX ; Get position of X axis.
  7. GetKeyState, JoyY, JoyY ; Get position of Y axis.
  8. KeyToHoldDownPrev = %KeyToHoldDown% ; Prev now holds the key that was down before (if any).
  9.  
  10.  
  11. if JoyY > 51
  12. KeyToHoldDown = LShift
  13. else if JoyY < 41
  14. KeyToHoldDown = Up
  15. else
  16. KeyToHoldDown =
  17.  
  18. if KeyToHoldDown = %KeyToHoldDownPrev% ; The correct key is already down (or no key is needed).
  19. return ; Do nothing.
  20.  
  21. ; Otherwise, release the previous key and press down the new key:
  22. SetKeyDelay -1 ; Avoid delays between keystrokes.
  23.  
  24. ; if KeyToHoldDownPrev ; There is a previous key to release.
  25. ; Send, {%KeyToHoldDownPrev% up} ; Release it.
  26.  
  27. if KeyToHoldDown ; There is a key to press down.
  28. Send, {%KeyToHoldDown%} ; Press it down.
  29. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement