hold a key and press another to activate a key Topic is solved

Ask gaming related questions (AHK v1.1 and older)
lancerbetter
Posts: 4
Joined: 22 Sep 2022, 16:22

hold a key and press another to activate a key

Post by lancerbetter » 22 Sep 2022, 16:27

I'm trying to make a code that lets me hold a and press shift to send a twice, isn't working and has locked me a key, can anyone help me?

Code: Select all

A & LShift::

send {a down}
sleep 50 
send {a up}
sleep 200
send {a down}
sleep 50 
send {a up}

return
the explanation is for Terraria I hate double pressing a key to dash with the shield of Cthulu so I want to be able to press shift to dash. Basically, I want to hold a key and press another to activate that held key twice.

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

Re: hold a key and press another to activate a key

Post by mikeyww » 23 Sep 2022, 06:10

Welcome to this AutoHotkey forum!

Does your script work in Notepad?

lancerbetter
Posts: 4
Joined: 22 Sep 2022, 16:22

Re: hold a key and press another to activate a key

Post by lancerbetter » 23 Sep 2022, 12:30

I am relatively new to AutoHotkey and I dont know

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

Re: hold a key and press another to activate a key

Post by mikeyww » 23 Sep 2022, 13:02

A way to tell:

1. Run Notepad.
2. Run your script.
3. Activate Notepad window.
4. Trigger your hotkey.
5. See if the script does what you expect in Notepad.

lancerbetter
Posts: 4
Joined: 22 Sep 2022, 16:22

Re: hold a key and press another to activate a key

Post by lancerbetter » 23 Sep 2022, 16:24

yes, as stated on my post, the A key is just locked entirely and provides no input

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

Re: hold a key and press another to activate a key  Topic is solved

Post by mikeyww » 23 Sep 2022, 16:57

A by itself is blocked via your custom combo.

https://www.autohotkey.com/docs/Hotkeys.htm#combo

You can fix the problem as noted there. This forces the lone hotkey to be triggered upon releasing it.

Code: Select all

a::a
a & LShift::Send x

lancerbetter
Posts: 4
Joined: 22 Sep 2022, 16:22

Re: hold a key and press another to activate a key

Post by lancerbetter » 05 Oct 2022, 17:06

thanks

Post Reply

Return to “Gaming Help (v1)”