Browse Source

fixes to repeat function, switch to use input by default except for turbo

master
Mar Alegre 2 years ago
parent
commit
60ce1527ce
  1. 18
      lib/HoldRepeat.ahk
  2. 2
      lib/Prelude.ahk
  3. 6
      src/AutorunAutoclick.ahk

18
lib/HoldRepeat.ahk

@ -44,7 +44,7 @@ HoldLoop(Primary, Secondary, Tertiary,Prefix) {
} }
} }
Repeat(Primary, Secondary,SendBlind:=true) { Repeat(Primary, Secondary:=[], SendBlind:=true) {
Prefix := _GetPrefix(SendBlind) Prefix := _GetPrefix(SendBlind)
Send Prefix "{" Primary " up}" Send Prefix "{" Primary " up}"
Sleep 100 Sleep 100
@ -58,19 +58,19 @@ Repeat(Primary, Secondary,SendBlind:=true) {
return return
} }
} }
if (RepeatVar == 1) { if (RepeatVar == 0) {
Send Prefix "{" Primary " down}"
RepeatVar := 0
} else {
Send Prefix "{" Primary " down}" Send Prefix "{" Primary " down}"
RepeatVar := 1 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 ; 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}" Send _GetPrefix(SendBlind) "{" Primary " down}"
if KeyWait(Primary, "D T0.2") { if KeyWait(Primary, "D T0.2") {
Repeat(Primary,Secondary,SendBlind) Repeat(Primary,Secondary,SendBlind)
@ -87,9 +87,9 @@ Turbo(Target,Hold:=Target) {
} else { } else {
_HoldRepeat_TurboOn[Target "_" Hold]:=1 _HoldRepeat_TurboOn[Target "_" Hold]:=1
While GetKeyState(Hold,"P") { While GetKeyState(Hold,"P") {
Send "{Blind}{" Target " down}" SendEvent "{Blind}{" Target " down}"
Sleep 10 Sleep 10
Send "{Blind}{" Target " up}" SendEvent "{Blind}{" Target " up}"
Sleep 10 Sleep 10
} }
_HoldRepeat_TurboOn[Target "_" Hold]:=0 _HoldRepeat_TurboOn[Target "_" Hold]:=0

2
lib/Prelude.ahk

@ -23,5 +23,5 @@ A_MenuMaskKey := "vkFF"
#SingleInstance force #SingleInstance force
; Send Mode ; Send Mode
SendMode "Event" SendMode "Input"
SetKeyDelay -1 SetKeyDelay -1

6
src/AutorunAutoclick.ahk

@ -12,11 +12,11 @@
; Hold/Autoclick mouse buttons ; Hold/Autoclick mouse buttons
; Holds if single click, autoclicks if double click ; Holds if single click, autoclicks if double click
*!LButton UP::HoldOrRepeat("LButton",[]) *!LButton UP::HoldOrRepeat("LButton")
*!RButton UP::HoldOrRepeat("RButton",[]) *!RButton UP::HoldOrRepeat("RButton")
; Hold/Repeat spacebar ; Hold/Repeat spacebar
*!Space UP::HoldOrRepeat("Space",[]) *!Space UP::HoldOrRepeat("Space")
; Autorun ; Autorun
*!w UP::Hold("w",["s"]) *!w UP::Hold("w",["s"])

Loading…
Cancel
Save