Advertisement
Elucia

JP

May 21st, 2020
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. ;rev1
  2. ;https://www.autohotkey.com/
  3.  
  4. SetWorkingDir %A_ScriptDir%
  5. #Include %A_ScriptDir%
  6. #SingleInstance ignore
  7. #Persistent
  8. SetTimer, WatchPOV, 5
  9. return
  10.  
  11. WatchPOV:
  12. POV := GetKeyState("JoyPOV")
  13. KeyToHoldDownPrev := KeyToHoldDown
  14.  
  15.  
  16. if (POV < 0)
  17. KeyToHoldDown := ""
  18. else if (POV > 31500)
  19. KeyToHoldDown := "Up"
  20. else if POV between 0 and 4500
  21. KeyToHoldDown := "Up"
  22. else if POV between 4501 and 13500
  23. KeyToHoldDown := "Right"
  24. else if POV between 13501 and 22500
  25. KeyToHoldDown := "Down"
  26. else
  27. KeyToHoldDown := "Left"
  28.  
  29. if (KeyToHoldDown = KeyToHoldDownPrev)
  30. {
  31. if KeyToHoldDown
  32. Send, {%KeyToHoldDown% down}
  33. return
  34. }
  35.  
  36. SetKeyDelay -1
  37. if KeyToHoldDownPrev
  38. Send, {%KeyToHoldDownPrev% up}
  39. if KeyToHoldDown
  40. Send, {%KeyToHoldDown% down}
  41. return
  42.  
  43. $Joy1::
  44. {
  45. SetKeyDelay 30,50
  46. Send, {ALT DOWN}{TAB}{ALT UP}
  47. }
  48. return
  49.  
  50. $Joy2::
  51. Send {Space down}
  52. SetTimer, WaitForJoy2, 30
  53. return
  54.  
  55. WaitForJoy2:
  56. if not GetKeyState("Joy2")
  57. {
  58. Send, {Space up}
  59. SetTimer, WaitForJoy2, Off
  60. return
  61. }
  62. Send, {Space down}
  63. return
  64.  
  65. $Joy3::Send, +,
  66. $Joy4::Send, ^r
  67. $F12::Suspend
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement