Need help holding multiple keys at once ><

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
LadySilverWings
Posts: 1
Joined: 18 Jul 2018, 18:09

Need help holding multiple keys at once ><

18 Jul 2018, 19:12

Hello!

I'm having trouble getting my script to press down 2 buttons simultaneously for a specified time and then releasing. I'm writing a music macro for a game and some of the music notes require holding either the shift or control key to go up and down an octave.

Now here's my code that I have for the first line of the song,

Code: Select all

^j::

sleep, 100
send, ]
sleep, 50
send, {i down}
sleep, 400
send, {i up}
sleep, 300
send, {+3 down}
sleep, 400
send, {+3 up}
sleep, 400
send, +r
sleep, 650
send, +3
sleep, 500
send, +r
sleep, 350
send, +r
sleep, 400
send, +r
sleep, 400
send, +7
sleep, 400
send, +6
sleep, 400
send, +t
sleep, 250
send, +r
sleep, 400
send, +t
return
So the idea is that when I press ctrl+j it executes the script and then plays those keys in the right order. But I can't get the keys to actually hold down for any length of time and I'm sure I'm inputting them in wrong, but I don't know how to fix it.

Sorry if this has already been asked before; I tried scouring google and while I found people that had similar problems, I couldn't find any solution that helps me with my own. Namely, pressing two keys such as shift+r and having them held down for a certain length of time before moving onto the next key. If anyone could show me what I'm doing wrong and what I'd need to do to edit this, I'd be super grateful! :D
Rohwedder
Posts: 7622
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Need help holding multiple keys at once ><

19 Jul 2018, 02:07

Hallo,
replace:

Code: Select all

send, {+3 down}
sleep, 400
send, {+3 up}
by:

Code: Select all

send, {Shift down}{3 down}
sleep, 400
send, {Shift up}{3 up}
{+3} addresses a key named "+3", you don't have that key!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 317 guests