Keyboard typing delay Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
ramrod14600
Posts: 2
Joined: 23 Jan 2022, 14:33

Keyboard typing delay

Post by ramrod14600 » 23 Jan 2022, 14:34

I have a very simple AutoHotKey script which I wish to introduce a visible delay between the characters typed ...I have read the documentation on SetKeyDelay but the example below does not seem to provide any key delay ...any thoughts ? I would expect that when I type **rpa** and the hit **enter** key, the characters would type *slowly* ...more like a human typing.

Code: Select all

    SetKeyDelay ,3000,200
    
    ::rpa::
    Send {Text} 
    (
    
    while ( iterator?.hasNext() ) {
        def comp = iterator.next()
        if (comp.sku != null ) {
            def row = [
                    "sku"         : comp.sku,
                    "ProductGroup": comp.attribute1,
                    "BusinessUnit": comp.attribute2
            ]
        }
    }
    
    )
    
    return
[Mod edit: [code][/code] tags added.]

User avatar
boiler
Posts: 16767
Joined: 21 Dec 2014, 02:44

Re: Keyboard typing delay

Post by boiler » 23 Jan 2022, 14:50

Your script types them much more slowly than a human would since there is a delay of three full seconds between characters. Are you sure closed other versions of the script and saved the file before running it again?

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

Re: Keyboard typing delay  Topic is solved

Post by gregster » 23 Jan 2022, 14:56

SetKeyDelay is not obeyed by Sendinput. So, if you set sendmode to Input mode (somewhere at the top of the script probably, like in the usual ahk-file template).... SetKeyDelay will have no effect. Also, are you sure that the SetKeyDelay line gets really executed (again assuming that this is not your complete script)?

ramrod14600
Posts: 2
Joined: 23 Jan 2022, 14:33

Re: Keyboard typing delay

Post by ramrod14600 » 23 Jan 2022, 16:07

Yep ...sure enough, the sendmode Input mode was set ...I am an obvious newbie to AutoHotKeys ....removing that one line solved the issue.

Thanks !

Post Reply

Return to “Ask for Help (v1)”