Sendinput skipping to new controlbox when followed by a ControlClick command

Report problems with documented functionality
Gibbons
Posts: 93
Joined: 20 Sep 2016, 20:39

Sendinput skipping to new controlbox when followed by a ControlClick command

19 Apr 2017, 21:45

A condensed version of my script:

Code: Select all

SendMode Input

ControlClick, % "Edit" . 12+n
Send, % parameter.tool . "{TAB}" . parameter.tooltName . "{TAB}" . parameter.method . "{TAB}" . parameter.copies . "{TAB}" . parameter.exitMethod . "{TAB}Yes{TAB 3}" . parameter.exit
; sleep, 100
ControlClick, % "Edit" . 1+nn
Send, Yes
WIthout the sleep, 100 command the program will ControlClick the first Edit box, and then ControlClick the second edit box before the Send command has finished, causing the text sent by Send to be in the wrong spot and sometimes capital and small letters are reversed.

The reason I can't use ControSetText or other methods is because I'm using a pre 2000 computer program and this in the only way I've found that works.

Thanks,
Gibbons
just me
Posts: 9451
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Sendinput skipping to new controlbox when followed by a ControlClick command

20 Apr 2017, 02:04

What makes you think this would be an AHK bug? You already found the reason and a solution. The receiving programm needs some time to process the input. You might consider to use a 'slower' SendMode.
Gibbons
Posts: 93
Joined: 20 Sep 2016, 20:39

Re: Sendinput skipping to new controlbox when followed by a ControlClick command

20 Apr 2017, 21:29

I was working off of this text from the documentation:
BlockInput Compared to SendInput/SendPlay: Although the BlockInput command can be used to prevent any keystrokes physically typed by the user from disrupting the flow of simulated keystrokes, it is often better to use SendInput or SendPlay so that keystrokes and mouse clicks become uninterruptible. This is because unlike BlockInput, SendInput/Play does not discard what the user types during the send; instead, such keystrokes are buffered and sent afterward.
I was under the impression that the purpose of SendInput was to stop (actually buffer) keys (and I assumed mouse clicks) from effecting the sent text, which was not happening. It seemed like the intent of the programmers was for SendInput NOT to be interupted by a ControlClick command, thus I felt it was a bug.

No worries either way, though, as I have a script that works and makes my job much easier and, thus, I am thankful for that.

Gibbons
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: Sendinput skipping to new controlbox when followed by a ControlClick command

20 Apr 2017, 22:08

... what the user types during the send; instead, such keystrokes are buffered and sent afterward.
The user typing != the script calling ControlClick. The user != the script.

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 51 guests