Advertisement
Guest User

Untitled

a guest
Feb 25th, 2020
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
  2. #Warn  ; Enable warnings to assist with detecting common errors.
  3. SendMode InputThenPlay ; Recommended for new scripts due to its superior speed and reliability.
  4.  
  5. lastSpaceTick := A_TickCount
  6. lastReleaseTick := A_TickCount
  7.  
  8. #IfWinActive ahk_class SDL_app
  9. $*LButton::
  10.    
  11. if !GetKeyState("Shift", "P") {
  12.     sinceLastSpace := A_TickCount - lastSpaceTick
  13.     sinceLastRelease := A_TickCount - lastReleaseTick
  14.     if (sinceLastSpace > 400 or sinceLastRelease < 200) {          
  15.         Send {Space Down}  
  16.         Sleep, 15  
  17.         Send {Space Up}
  18.         lastSpaceTick := A_TickCount                       
  19.     }              
  20. }
  21.  
  22. Send {LButton Down}    
  23. Sleep, 15
  24. if GetKeyState("LButton") and !GetKeyState("Shift", "P") {
  25.     Send {LButton Up}
  26.     lastReleaseTick := A_TickCount
  27. }
  28.  
  29. return
  30.  
  31. ~*LButton Up::
  32. lastReleaseTick := A_TickCount
  33. return
  34.  
  35. ~*Space::
  36. lastSpaceTick := A_TickCount
  37. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement