diff --git a/lib/HoldRepeat.ahk b/lib/HoldRepeat.ahk index cc7c915..f0e39a1 100644 --- a/lib/HoldRepeat.ahk +++ b/lib/HoldRepeat.ahk @@ -12,13 +12,13 @@ _GetPrefix(SendBlind) { } } -Hold(Primary, Secondary:=[],Tertiary:=[],SendBlind:=true) { +Hold(Primary, Secondary:=[], Tertiary:=[], SendBlind:=true) { Prefix := _GetPrefix(SendBlind) Send Prefix "{" Primary " down}" SetTimer HoldLoop.Bind(Primary,Secondary,Tertiary,Prefix), 50 } -HoldLoop(Primary, Secondary, Tertiary,Prefix) { +HoldLoop(Primary, Secondary, Tertiary, Prefix) { if GetKeyState(Primary,"P") { SetTimer , 0 return @@ -44,7 +44,7 @@ HoldLoop(Primary, Secondary, Tertiary,Prefix) { } } -Repeat(Primary, Secondary,SendBlind:=true) { +Repeat(Primary, Secondary:=[], SendBlind:=true) { Prefix := _GetPrefix(SendBlind) Send Prefix "{" Primary " up}" Sleep 100 @@ -58,19 +58,19 @@ Repeat(Primary, Secondary,SendBlind:=true) { return } } - if (RepeatVar == 1) { - Send Prefix "{" Primary " down}" - RepeatVar := 0 - } else { + if (RepeatVar == 0) { Send Prefix "{" Primary " down}" RepeatVar := 1 + } else { + Send Prefix "{" Primary " up}" + RepeatVar := 0 } - Sleep 100 + Sleep 50 } } ; Sets key to hold if single tap, or repeat if double tap -HoldOrRepeat(Primary, Secondary,SendBlind:=True) { +HoldOrRepeat(Primary, Secondary:=[], SendBlind:=True) { Send _GetPrefix(SendBlind) "{" Primary " down}" if KeyWait(Primary, "D T0.2") { Repeat(Primary,Secondary,SendBlind) @@ -80,16 +80,16 @@ HoldOrRepeat(Primary, Secondary,SendBlind:=True) { } ; Press Target button extremely rapidly while Hold button is held down -Turbo(Target,Hold:=Target) { +Turbo(Target, Hold:=Target) { global _HoldRepeat_TurboOn If (_HoldRepeat_TurboOn.Has(Target "_" Hold) and _HoldRepeat_TurboOn[Target "_" Hold]) { return } else { _HoldRepeat_TurboOn[Target "_" Hold]:=1 While GetKeyState(Hold,"P") { - Send "{Blind}{" Target " down}" + SendEvent "{Blind}{" Target " down}" Sleep 10 - Send "{Blind}{" Target " up}" + SendEvent "{Blind}{" Target " up}" Sleep 10 } _HoldRepeat_TurboOn[Target "_" Hold]:=0 diff --git a/lib/Prelude.ahk b/lib/Prelude.ahk index 947b845..1154c7a 100644 --- a/lib/Prelude.ahk +++ b/lib/Prelude.ahk @@ -23,5 +23,5 @@ A_MenuMaskKey := "vkFF" #SingleInstance force ; Send Mode -SendMode "Event" +SendMode "Input" SetKeyDelay -1 \ No newline at end of file diff --git a/src/AutorunAutoclick.ahk b/src/AutorunAutoclick.ahk index 0e934a1..2f88ea9 100644 --- a/src/AutorunAutoclick.ahk +++ b/src/AutorunAutoclick.ahk @@ -12,11 +12,11 @@ ; Hold/Autoclick mouse buttons ; Holds if single click, autoclicks if double click -*!LButton UP::HoldOrRepeat("LButton",[]) -*!RButton UP::HoldOrRepeat("RButton",[]) +*!LButton UP::HoldOrRepeat("LButton") +*!RButton UP::HoldOrRepeat("RButton") ; Hold/Repeat spacebar -*!Space UP::HoldOrRepeat("Space",[]) +*!Space UP::HoldOrRepeat("Space") ; Autorun *!w UP::Hold("w",["s"])