TimBlo
TimBlo

Reputation: 33

AutoIt Send() whithout interrupting pressed keys

Understanding the problem is quite easy - each time AutoIt is sending its stuff, a keyboard-user's stuff gets missed exactly the Opt("SendKeyDownDelay",50) time.

Upvotes: 0

Views: 8214

Answers (3)

TimBlo
TimBlo

Reputation: 33

In my case, the Opt("SendKeyDownDelay",50) statement is given and a keyboard-emulation is absolutely welcome.

AutoIt was very user-friendly there.
Finally,

Send("{X DOWN}")
Sleep(50)
Send("{X UP}")

And the Opt("SendKeyDownDelay",0) statement can do exactly what was excepted. You'd need a function to send strings, but the key down time is easy to change with that method.

Maybe someone can use that, i can. (Remember to replace X with a key of your choice)
Thanks for your tips and greetings
Tim

Upvotes: 0

John Dorian
John Dorian

Reputation: 1904

If you want to send data as quickly as possible in addition to not interrupting you can use the clipboard.

Here are three examples:

Example one (listed above):

$data = "I want to send this!"
ControlSend( "", "", "", $data )

Example Two (fastest way):

$data = "I want to send this!"
ClipPut($data) ;puts text in clipboard
ControlSend( "", "", "", "^v" ) ;pastes text instantly

Example Three (clipboard without ControlSend):

$data = "I want to send this!"
ClipPut($data)
Send("^v")

Additionally you can clear the clipboard with: ClipPut('')

Upvotes: 2

Milos
Milos

Reputation: 2946

The alternative to send is ControlSend ( "", "", "", "e")

This will send an "e" to an active window without interrupting the input.

Upvotes: 2

Related Questions