Key replacement Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
AcidoX
Posts: 12
Joined: 27 Jun 2017, 11:56

Key replacement

27 Jun 2017, 12:06

I'm trying to create an autofire button

Here is my code:
__________________________________
$~a::
while (getKeyState("a", "P"))
{
send, {z down}
sleep, 20
send, {z up}
}
return
___________________________________

the problem is that when I press "a", the code will start sending "a + z" together, I want to replace the key "a" completely to just send "z" only, how?
mlevanduski
Posts: 2
Joined: 27 Jun 2017, 11:03

Re: Key replacement

27 Jun 2017, 12:10

Sounds like you want to remap a to z. Which can be done like this:

a::b
AcidoX
Posts: 12
Joined: 27 Jun 2017, 11:56

Re: Key replacement

27 Jun 2017, 12:13

No no, I want that when I press the key 'a' to start sending
send, {z down}
sleep, 20
send, {z up}
and the problem is when I press 'a' it will start sending A + Z together, I want it only to send 'Z sleep 20' only?

EDIT:
I just want someone to correct my code
this code is for Mega Man game turbo button

Code is:
*~$a::
while (getKeyState("a", "P"))
{
send, {z}
sleep, 20
}
return

When I press A it will be like this: zazazazazazazazazazazazazazazzaza
I want it to be like this: zzzzzzzzzzzzzz every time I press a
Hope somebody would help:)
Last edited by AcidoX on 27 Jun 2017, 12:44, edited 1 time in total.
User avatar
derz00
Posts: 497
Joined: 02 Feb 2016, 17:54
Location: Middle of the round cube
Contact:

Re: Key replacement  Topic is solved

27 Jun 2017, 12:37

take out the ~ that's why its sending "a" and probably the $ is unnecessary though that isn't the problem.
try it and see
...
AcidoX
Posts: 12
Joined: 27 Jun 2017, 11:56

Re: Key replacement

27 Jun 2017, 12:45

Thank you derzo00

it works now like charm!:)

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: jeves and 154 guests