AHK Script Won't Active While Pressing Other Buttons

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Frankie158
Posts: 4
Joined: 13 Dec 2017, 08:23

AHK Script Won't Active While Pressing Other Buttons

06 Jul 2018, 20:18

Hey, I'm having trouble with a hotkey command. Basically, I have it setup so if I click my side mouse buttons, it clicks one key, than presses another on a constant loop until I release the mouse button. It seems to function properly, however if I'm pressing another button, the function won't activate. It's for a game, if I'm standing still, it plays the command perfectly. But once moving around normally in game, it just won't do anything.
Here's the script

Code: Select all

XButton1::
Send, i
loop
{
if not getkeystate("XButton1", "p")
break
Send, [
Sleep, 7
}
return

XButton2::
Send, o
loop
{
if not getkeystate("XButton2", "p")
break
Send, [
Sleep, 7
}
return
Thanks :)
Shade4Real
Posts: 16
Joined: 16 Jun 2018, 00:54

Re: AHK Script Won't Active While Pressing Other Buttons

14 Jul 2018, 21:23

The '~' means under any circumstance
So under any circumstance if XButton1 is pressed, continue script

Code: Select all

~$XButton1::
Send, i
loop
{
if not getkeystate("XButton1", "p")
break
Send, [
Sleep, 7
}
return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Descolada, mikeyww, peter_ahk, Spawnova, toddhere, USS_Sandhu and 319 guests