Advertisement
kurruk

Input Focus

Apr 18th, 2020
1,570
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #Persistent
  2. SetTimer, WatchAxis, 100
  3. return
  4.  
  5. WatchAxis:
  6.     ;Get the axis input for all 6 controllers then floors those outputs into their own vars.
  7.     Loop 6
  8.     {
  9.         GetKeyState, XAxis, %A_Index%JoyX
  10.         GetKeyState, YAxis, %A_Index%JoyY
  11.         GetKeyState, ZAxis, %A_Index%JoyZ
  12.         %A_Index%XAxis := Floor(XAxis)  
  13.         %A_Index%YAxis := Floor(YAxis)
  14.         %A_Index%ZAxis := Floor(ZAxis)
  15.     }
  16.     Loop 6
  17.     {
  18.         ;Compares the last run of input to the current inputs and activates the window
  19.         if (%A_Index%XAxis - %A_Index%XAxisPrev > 10 || %A_Index%XAxis - %A_Index%XAxisPrev < -10) or (%A_Index%YAxis - %A_Index%YAxisPrev > 10 || %A_Index%YAxis - %A_Index%YAxisPrev < -10) or (%A_Index%ZAxis - %A_Index%ZAxisPrev > 10 || %A_Index%ZAxis - %A_Index%ZAxisPrev < -10)
  20.         {
  21.             IfWinExist, Elite - Dangerous (CLIENT)
  22.             {
  23.                 %A_Index%XAxisPrev := %A_Index%XAxis
  24.                 %A_Index%YAxisPrev := %A_Index%YAxis
  25.                 %A_Index%ZAxisPrev := %A_Index%ZAxis
  26.                 WinActivate
  27.             }
  28.         }
  29.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement