AHK did not press 70 UP keys for me Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
kwfine
Posts: 16
Joined: 26 Nov 2015, 06:46

AHK did not press 70 UP keys for me

03 Jun 2018, 12:07

Hi all,

I am using Version v1.1.23.03 in WIndows 7 and 10.

This is my custom simple function:

Code: Select all

test(howmany){
 Send, {UP %howmany%}
}
but I found that, when I put in a large number, for example 70 as in test(70),
AHK did not really press 70 UP keys for me. I figured out only 36 UP keys were pressed.

Could you tell me why this happened?

Thank you!

Kitty
wolf_II
Posts: 2688
Joined: 08 Feb 2015, 20:55

Re: AHK did not press 70 UP keys for me  Topic is solved

03 Jun 2018, 12:15

I figured out only 36 UP keys were pressed.
Maybe you were unable to count correctly, while AHK did sent 70 keypresses.
Maybe you counted correctly and 36 is all that was sent by AHK.

Unless you tell us also how you counted, my guess is conform with the first possibility.
wolf_II
Posts: 2688
Joined: 08 Feb 2015, 20:55

Re: AHK did not press 70 UP keys for me

03 Jun 2018, 12:21

I tested the following script:

Code: Select all

F12:: test(70)
test(howmany) {
 Send, {UP %howmany%}
}
It sends 70 keypresses of UP-arrows. I counted as follows:

Run the script.
Open Notepad++ with a file containing ~2500 lines.
move the text cursor to the end of line 2000.
Press F12.
check the position of the text cursor.
Result: 1930
gregster
Posts: 9012
Joined: 30 Sep 2013, 06:48

Re: AHK did not press 70 UP keys for me

03 Jun 2018, 12:26

Not every program might be able to process all 70 key presses in a short time.
User avatar
evilC
Posts: 4823
Joined: 27 Feb 2014, 12:30

Re: AHK did not press 70 UP keys for me

04 Jun 2018, 07:09

What is telling you that only 36 got pressed?
Add SetKeyDelay, 0, 50 to the start of the script, re-run. Does it now say 70?

I bet that the reason you think it is sending half that amount is that the app is polling keys rather than responding to events, and due to the frequency of it's polling loop, only sees every other key pressed.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Dobbythenerd1, Google [Bot] and 329 guests