Hotstring Key delay

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
jrachr
Posts: 545
Joined: 01 Mar 2021, 17:33

Hotstring Key delay

Post by jrachr » 10 Apr 2024, 14:45

Good day.Trying to find a way to put a key delay between the key presses in this hotstring between the 2 L's. Can it be done?

Code: Select all

:*:LL::

gregster
Posts: 9071
Joined: 30 Sep 2013, 06:48

Re: Hotstring Key delay

Post by gregster » 10 Apr 2024, 14:49

Just type slower ;) Or who is doing the typing on your computer?
The output could be slowed down by the Kn option, of course.

jrachr
Posts: 545
Joined: 01 Mar 2021, 17:33

Re: Hotstring Key delay

Post by jrachr » 10 Apr 2024, 14:51

@gregster. That part I knew. Sometimes have trouble typing slow. Was just hoping there was another option. If slower is only way then so be it.

gregster
Posts: 9071
Joined: 30 Sep 2013, 06:48

Re: Hotstring Key delay

Post by gregster » 10 Apr 2024, 14:55

I don't understand the problem. Do you want to get different results based on the time passed between the manual typing of the first and the second L ?

jrachr
Posts: 545
Joined: 01 Mar 2021, 17:33

Re: Hotstring Key delay

Post by jrachr » 10 Apr 2024, 15:03

@gregster. I am trying to get a delay so when for example I am typing in notepad and type still I don't hit the 2 L's to quick and Activate this Hotstring.

:*:LL::
Run, D:\PortableApps\AutoHotkeyPortable\Jr Script's\Eastlink.ahk
Return

gregster
Posts: 9071
Joined: 30 Sep 2013, 06:48

Re: Hotstring Key delay

Post by gregster » 10 Apr 2024, 15:28

So, something similar to example #7 in the KeyWait docs?

This will only react to capital Ls (although your hotstring above would also react to small ls as long as you don't use the C hotstring option.)

Code: Select all

~+l::
if (A_PriorHotkey != "~+l" or A_TimeSincePriorHotkey > 250)
{
    ; Too much time between presses, so this isn't a double-press.
    KeyWait, l
    return
}
MsgBox You double-pressed the shifted l key (L) in less than 250 ms.
return
Change the delay to your personal preference. You could also replace the + with * (in lines 1 and 2) to make it case-insensitive like your hotstring above.

jrachr
Posts: 545
Joined: 01 Mar 2021, 17:33

Re: Hotstring Key delay

Post by jrachr » 10 Apr 2024, 15:32

@gregster. I will try it out. Look's like it should work. Thank You. Cheer's

Post Reply

Return to “Ask for Help (v1)”