|
|
@ -2,6 +2,8 @@ |
|
|
|
; Functions for holding and repeating keys |
|
|
|
; |
|
|
|
|
|
|
|
_TurboOn := [] |
|
|
|
|
|
|
|
Hold(Primary, Secondary) { |
|
|
|
Send {%Primary% down} |
|
|
|
if ( Secondary.Length() != 0 ) { |
|
|
@ -17,7 +19,7 @@ HoldLoop(Primary, Secondary) { |
|
|
|
} |
|
|
|
for index,key in Secondary { |
|
|
|
if GetKeyState(key,"P") { |
|
|
|
Send {%Primary% up} |
|
|
|
Send,{Blind} {%Primary% up} |
|
|
|
SetTimer, , Delete |
|
|
|
return |
|
|
|
} |
|
|
@ -25,7 +27,7 @@ HoldLoop(Primary, Secondary) { |
|
|
|
} |
|
|
|
|
|
|
|
Repeat(Primary, Secondary) { |
|
|
|
Send {%Primary% up} |
|
|
|
Send,{Blind} {%Primary% up} |
|
|
|
Sleep 100 |
|
|
|
RepeatVar := 0 |
|
|
|
Loop { |
|
|
@ -38,10 +40,10 @@ Repeat(Primary, Secondary) { |
|
|
|
} |
|
|
|
} |
|
|
|
if (RepeatVar == 1) { |
|
|
|
Send, {%Primary% down} |
|
|
|
Send,{Blind} {%Primary% down} |
|
|
|
RepeatVar := 0 |
|
|
|
} else { |
|
|
|
Send, {%Primary% up} |
|
|
|
Send,{Blind} {%Primary% up} |
|
|
|
RepeatVar := 1 |
|
|
|
} |
|
|
|
Sleep 100 |
|
|
@ -50,7 +52,7 @@ Repeat(Primary, Secondary) { |
|
|
|
|
|
|
|
; Sets key to hold if single tap, or repeat if double tap |
|
|
|
HoldOrRepeat(Primary, Secondary) { |
|
|
|
Send {%Primary% down} |
|
|
|
Send,{Blind} {%Primary% down} |
|
|
|
KeyWait, %Primary%, D, T0.2 |
|
|
|
if (ErrorLevel = 0) { |
|
|
|
Repeat(Primary,Secondary) |
|
|
@ -61,10 +63,17 @@ HoldOrRepeat(Primary, Secondary) { |
|
|
|
|
|
|
|
; Press Target button extremely rapidly while Hold button is held down |
|
|
|
Turbo(Target,Hold) { |
|
|
|
While GetKeyState(Hold,"P") { |
|
|
|
SendInput, {%Target% down} |
|
|
|
Sleep 25 |
|
|
|
SendInput, {%Target% up} |
|
|
|
Sleep 25 |
|
|
|
global _TurboOn |
|
|
|
If (_TurboOn["%Target%_%Hold%"]) { |
|
|
|
return |
|
|
|
} else { |
|
|
|
_TurboOn["%Target%_%Hold%"]:=1 |
|
|
|
While GetKeyState(Hold,"P") { |
|
|
|
Send,{Blind} {%Target% down} |
|
|
|
Sleep 25 |
|
|
|
Send,{Blind} {%Target% up} |
|
|
|
Sleep 25 |
|
|
|
} |
|
|
|
_TurboOn["%Target%_%Hold%"]:=0 |
|
|
|
} |
|
|
|
} |