Browse Source

namespace global library variable

master
Mar Alegre 3 years ago
parent
commit
f28b62238c
  1. 10
      lib/HoldRepeat.ahk

10
lib/HoldRepeat.ahk

@ -2,7 +2,7 @@
; Functions for holding and repeating keys ; Functions for holding and repeating keys
; ;
_TurboOn := Map() _HoldRepeat_TurboOn := Map()
Hold(Primary, Secondary:=[],Tertiary:=[]) { Hold(Primary, Secondary:=[],Tertiary:=[]) {
Send "{Blind}{" Primary " down}" Send "{Blind}{" Primary " down}"
@ -71,17 +71,17 @@ HoldOrRepeat(Primary, Secondary) {
; Press Target button extremely rapidly while Hold button is held down ; Press Target button extremely rapidly while Hold button is held down
Turbo(Target,Hold:=Target) { Turbo(Target,Hold:=Target) {
global _TurboOn global _HoldRepeat_TurboOn
If (_TurboOn.Has(Target "_" Hold) and _TurboOn[Target "_" Hold]) { If (_HoldRepeat_TurboOn.Has(Target "_" Hold) and _HoldRepeat_TurboOn[Target "_" Hold]) {
return return
} else { } else {
_TurboOn[Target "_" Hold]:=1 _HoldRepeat_TurboOn[Target "_" Hold]:=1
While GetKeyState(Hold,"P") { While GetKeyState(Hold,"P") {
Send "{Blind}{" Target " down}" Send "{Blind}{" Target " down}"
Sleep 10 Sleep 10
Send "{Blind}{" Target " up}" Send "{Blind}{" Target " up}"
Sleep 10 Sleep 10
} }
_TurboOn[Target "_" Hold]:=0 _HoldRepeat_TurboOn[Target "_" Hold]:=0
} }
} }
Loading…
Cancel
Save