Advertisement
Guest User

X4 T.Flight Hotas X HAT Switch Diagonal Strafing Fix

a guest
Dec 14th, 2018
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 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. KeyToHoldDownPrev1 = %KeyToHoldDown1%
  11. KeyToHoldDownPrev2 = %KeyToHoldDown2%
  12.  
  13. if (POV = -1) {
  14. KeyToHoldDown1 =
  15. KeyToHoldDown2 =
  16. KeyC = 0
  17. if (KeyToHoldDownPrev1 <> "") {
  18. Send, {%KeyToHoldDownPrev1% up}
  19. }
  20. if (KeyToHoldDownPrev2 <> "") {
  21. Send, {%KeyToHoldDownPrev2% up}
  22. }
  23. }
  24. else if (POV = 0) {
  25. KeyToHoldDown1 = Up
  26. KeyToHoldDown2 =
  27. KeyC = 1
  28. }
  29. else if (POV = 4500) {
  30. KeyToHoldDown1 = Up
  31. KeyToHoldDown2 = Right
  32. KeyC = 2
  33. }
  34. else if (POV = 9000) {
  35. KeyToHoldDown1 = Right
  36. KeyToHoldDown2 =
  37. KeyC = 1
  38. }
  39. else if (POV = 13500) {
  40. KeyToHoldDown1 = Right
  41. KeyToHoldDown2 = Down
  42. KeyC = 2
  43. }
  44. else if (POV = 18000) {
  45. KeyToHoldDown1 = Down
  46. KeyToHoldDown2 =
  47. KeyC = 1
  48. }
  49. else if (POV = 22500) {
  50. KeyToHoldDown1 = Down
  51. KeyToHoldDown2 = Left
  52. KeyC = 2
  53. }
  54. else if (POV = 27000) {
  55. KeyToHoldDown1 = Left
  56. KeyToHoldDown2 =
  57. KeyC = 1
  58. }
  59. else if (POV = 31500) {
  60. KeyToHoldDown1 = Left
  61. KeyToHoldDown2 = Up
  62. KeyC = 2
  63. }
  64.  
  65. if (KeyToHoldDown1 = %KeyToHoldDownPrev1% and KeyToHoldDown2 = %KeyToHoldDownPrev2%) {
  66. return
  67. }
  68.  
  69. SetKeyDelay -1
  70.  
  71. if (KeyToHoldDownPrev1 <> "") {
  72. Send, {%KeyToHoldDownPrev1% up}
  73. }
  74.  
  75. if (KeyToHoldDownPrev2 <> "") {
  76. Send, {%KeyToHoldDownPrev2% up}
  77. }
  78.  
  79. if (KeyC = 1) {
  80. Send, {%KeyToHoldDown1% down}
  81. }
  82.  
  83. if (KeyC = 2) {
  84. Send, {%KeyToHoldDown1% down}
  85. Send, {%KeyToHoldDown2% down}
  86. }
  87.  
  88. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement