Spaming a key without losing Ctrl, Alt and Caps modifiers

Ask gaming related questions
Gael4
Posts: 1
Joined: 20 Oct 2019, 06:12

Spaming a key without losing Ctrl, Alt and Caps modifiers

20 Oct 2019, 06:21

Hello everyone !

I recently discovered autohotkey and it helps me play wow without developing arthritis, however there is a big issue with every script I have tried that spams a key with a toggle :
it prevents me from using modifiers. In a game like wow where half of my key binds use modifiers it can be a death sentence ! Is there a way around it ? I can use regular keybinds just fine while the script is active, just not the aforementioned.

Here are the scripts I tried :

1st try :

Code: Select all

~<::
loop
{
  GetKeyState, NumLockState, NumLock, T

  if (NumLockState = "U") {
	break
  }     else {
	Send <
	Sleep, 10 ; Sleep for 20 msec
	GetKeyState, state, 5, P
	if state = U ; The key has been released, so break out of the loop.
	 break
  }
}
return

2nd try :

Code: Select all

<::
If State=20
State=Off
else
State=20
SetTimer SendKey, %State%
Return

SendKey:
Send <
Return

3rd try :

Code: Select all

OneToggle=0
#IfWinActive World of Warcraft
; to force the hotkey only to Wow
<::
if (OneToggle := !OneToggle)
SetTimer, timer, -1
return
#ifWinActive
; to end the WoW key binding
timer:
While (OneToggle)
{ Send <
sleep 100
}
Return
[Mod edit: [code][/code] tags added]


I am very bad at scripting so I just copied those scripts and changed the key.

Thanks in advance !

Return to “Gaming”

Who is online

Users browsing this forum: No registered users and 8 guests