Script doesn't work while shift is being held down Topic is solved

Ask gaming related questions (AHK v1.1 and older)
pawoir
Posts: 1
Joined: 22 May 2022, 13:02

Script doesn't work while shift is being held down

Post by pawoir » 22 May 2022, 13:04

Code: Select all

XButton2::autoClick("L", 18)          

autoClick(button, cps := 100) {       
 SetMouseDelay, 1000 / cps            
 While GetKeyState(A_ThisHotkey, "P") 
  Click, %button%                   
}
Title says it all, whenever I'm pressing shift and XButton2 at the same time the autoclicker doesn't work.

User avatar
mikeyww
Posts: 26885
Joined: 09 Sep 2014, 18:38

Re: Script doesn't work while shift is being held down  Topic is solved

Post by mikeyww » 22 May 2022, 14:39

Code: Select all

XButton2::
+XButton2::autoClick(RegExReplace(A_ThisHotkey, "\W"), "L", 18)

autoClick(hk, button, cps := 100) {
 SetMouseDelay, 1000 / cps
 While GetKeyState(hk, "P") {
  Click, %button%
  SoundBeep, 1500
 }
}

Post Reply

Return to “Gaming Help (v1)”