Advertisement
Guest User

Untitled

a guest
Dec 15th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
  2. SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
  3. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
  4.  
  5. #Persistent ; Keep this script running until the user explicitly exits it.
  6. SetTimer, WatchPOV, 5
  7. return
  8. WatchPOV:
  9. GetKeyState, POV, JoyPOV
  10.  
  11. KeyToHoldDownPrev = %KeyToHoldDown%
  12.  
  13. if POV = -1
  14. KeyToHoldDown = Numpad5
  15. else if POV = 0
  16. KeyToHoldDown = Numpad8
  17. else if POV = 4500
  18. KeyToHoldDown = Numpad9
  19. else if POV = 9000
  20. KeyToHoldDown = Numpad6
  21. else if POV = 13500
  22. KeyToHoldDown = Numpad3
  23. else if POV = 18000
  24. KeyToHoldDown = Numpad2
  25. else if POV = 22500
  26. KeyToHoldDown = Numpad1
  27. else if POV = 27000
  28. KeyToHoldDown = Numpad4
  29. else if POV = 31500
  30. KeyToHoldDown = Numpad7
  31.  
  32. if KeyToHoldDown = %KeyToHoldDownPrev%
  33. return
  34. else
  35. ;msgbox %KeyToHoldDown%
  36.  
  37. ;SetKeyDelay -1
  38.  
  39. if KeyToHoldDownPrev <> ""
  40. Send, {%KeyToHoldDownPrev% up}
  41.  
  42. Send, {%KeyToHoldDown% down}
  43. Send, {%KeyToHoldDown% up}
  44.  
  45. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement