Looking for help

Ask gaming related questions (AHK v1.1 and older)
deathrament2
Posts: 18
Joined: 18 Nov 2021, 20:20

Looking for help

Post by deathrament2 » 01 Oct 2022, 10:10

Hi i'm looking for help with script. What i want is when i'm holding shift down i want at the same time for it to hit 5 once.
Thanks

Rohwedder
Posts: 7644
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Looking for help

Post by Rohwedder » 01 Oct 2022, 10:21

Hallo,
try:

Code: Select all

~Shift::
Send, 5
KeyWait, Shift
Return

deathrament2
Posts: 18
Joined: 18 Nov 2021, 20:20

Re: Looking for help

Post by deathrament2 » 01 Oct 2022, 10:28

That works, but there is a little delay between when i hold shift and then it hit's 5. Is there anyway to make it hit 5 faster.

deathrament2
Posts: 18
Joined: 18 Nov 2021, 20:20

Re: Looking for help

Post by deathrament2 » 01 Oct 2022, 19:26

This code works without delay but it will also run the script if i hit 5 as well which i don't want.

Code: Select all

Shift::
	Send {Shift down}{Shift Down}
	
        Send {5}
Return

Rohwedder
Posts: 7644
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Looking for help

Post by Rohwedder » 01 Oct 2022, 23:50

there is a little delay between when i hold shift and then it hit's 5.
If you notice a delay, the culprit is your application. Try:

Code: Select all

~Shift::
Send, 5
KeyHistory
KeyWait, Shift
Return
VK SC Type Up/Dn Elapsed Key Window
-------------------------------------------------------------------------------------------------------------
A0 02A h d 7.91 LShift Unbenannt - Editor
A0 02A i u 0.00 LShift
35 006 i d 0.00 5
35 006 i u 0.00 5
A0 02A i d 0.01 LShift

I started the script here, and after (measured 7.91 seconds) pressed LShift. Immediately (0.00 seconds) after that the 5 was pressed by the script.

Post Reply

Return to “Gaming Help (v1)”