Need help Hold shift repeat Q Xbutton 2

Ask gaming related questions (AHK v1.1 and older)
Solus420
Posts: 7
Joined: 20 Jul 2017, 10:56

Need help Hold shift repeat Q Xbutton 2

08 Dec 2017, 13:28

o7 hey all kinda stumped on how to do this when i had a gaming mouse i used the provided editor to make mouse button 5 hold shift while repeating q while the mouse button was pressed. That mouse broke and since im without a gaming mouse i am trying to substitute the same effect with AHK. Below is what i came up with but doesnt seem to be working. I need this to repeat the q while holding the shift as fast as it can.

Code: Select all

XButton2::
	
   While (!GetKeyState("xButton2","P"))
   {   
       SendInput {Shift Down}
       Loop
       (
       SendInput "q"
       )
       If (!GetKeyState("xButton2","P"))
           break
       SendInput {shift up}
       
   }

   Return
  
Rohwedder
Posts: 7624
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Need help Hold shift repeat Q Xbutton 2

08 Dec 2017, 13:42

Hallo,
untested (If have no XButtons)
try:

Code: Select all

XButton2::	
	SendInput {Shift Down}
	While GetKeyState("XButton2","P")        
		SendInput q
	SendInput {Shift up}
Return
Solus420
Posts: 7
Joined: 20 Jul 2017, 10:56

Re: Need help Hold shift repeat Q Xbutton 2

08 Dec 2017, 14:00

Rohwedder wrote:Hallo,
untested (If have no XButtons)
try:

Code: Select all

XButton2::	
	SendInput {Shift Down}
	While GetKeyState("XButton2","P")        
		SendInput q
	SendInput {Shift up}
Return

Well it works if caps locks is off which is really confusing me any reason this would be i need this to work no matter if capslocks is on or not
Last edited by Solus420 on 08 Dec 2017, 14:02, edited 1 time in total.
Solus420
Posts: 7
Joined: 20 Jul 2017, 10:56

Re: Need help Hold shift repeat Q Xbutton 2

08 Dec 2017, 14:01

Whoops not solved clicked wrong thing Also may need to turn the repeat of it down some its lagging the game when using
Solus420
Posts: 7
Joined: 20 Jul 2017, 10:56

Re: Need help Hold shift repeat Q Xbutton 2

08 Dec 2017, 14:31

I have fixed the repeat issue but it still isnt working with caps locks on

Heres what i have currently but if Capslocks is on it wont work but with it off it will i need it to work no matter if on or off

Code: Select all

Setkeydelay, 20

XButton2::	
	SendInput {Shift Down}
	While GetKeyState("XButton2","P")        
		SendInput q
	SendInput {Shift up}
Return
Rohwedder
Posts: 7624
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Need help Hold shift repeat Q Xbutton 2

09 Dec 2017, 03:53

Hallo,
SetKeyDelay is not obeyed by SendInput; there is no delay between keystrokes in that mode.
Therefore I changed SendInput to Send.
Try:

Code: Select all

Setkeydelay, 20

*XButton2:: ;triggers independent of modifiers like Shift or Capslock
	While GetKeyState("XButton2","P")        
		Send +q ;sends Shift+q independent of Capslock
Return

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: prototype_zero and 83 guests