Sign in to follow this  
Followers 0
bigred

opt("SendKeyDelay", -0 )?

9 posts in this topic

Is there any way to have the text being sent by the send command to appear instantly? I need it to work the same way the ControlSetText and ControlCommand(EditPaste) work, in the way that the text appears instantly in the edit field.

Any ideas? Or would this need to be implemented by the Devs?

Share this post


Link to post
Share on other sites



What about using ControlSetText as you already said?

You can't have the same effect with Send()...

If you are really really stuck you may try Autoit2 that could.

Share this post


Link to post
Share on other sites

Send cannot instantly send different keys. Same as when you try to enter text on your keyboard. If you'd press all keys for one word you'll just have character jam and not the text you wanted. So Send basically does the same as you: pressing one key after the other.

If you need to show some text instantly, you could try working with the clipboard. Copy the text to clipboard and then paste it.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

What about using ControlSetText as you already said?

You can't have the same effect with Send()...

If you are really really stuck you may try Autoit2 that could.

<{POST_SNAPBACK}>

I need to send variables in the text string and so far I haven't found a way to encapsulate them into a ControlSetText or ControlCommand(EditPaste) string.

I could use EditPaste a bunch of times but that would not be practical in this case. Check out post #9 in this thread for an explanation.

http://www.autoitscript.com/forum/index.php?showtopic=4646

EDIT: Err nevermind I think JdeB has solved the issue of using ControlSend.

Send cannot instantly send different keys. Same as when you try to enter text on your keyboard. If you'd press all keys for one word you'll just have character jam and not the text you wanted. So Send basically does the same as you: pressing one key after the other.

If you need to show some text instantly, you could try working with the clipboard. Copy the text to clipboard and then paste it.

<{POST_SNAPBACK}>

True, but the other text send commands can do it, why not this one? I just need a command that will let me send text instantly with encapsulated variables. Oh and it has to be as reliable as possible. :ph34r:

Well I need to encapsulate variables in the string. How could I do that prior to putting it in the clipboard?

Have the sendkeydelay and keydowndelay set to -1.  That is the quickest that send will work but then you might have reliability issues.

<{POST_SNAPBACK}>

Ahh that worked pretty well. What sort of reliability issues might I face? What would the cause be, and is there a way to help prevent them without upping the delays? Edited by bigred

Share this post


Link to post
Share on other sites

That works! Thanks! :ph34r:

Wow there are so many ways to do one thing its rather confusing. From the help file I didn't know you could do the & whatever thing like with Send.

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

True, but the other text send commands can do it, why not this one?  I just need a command that will let me send text instantly with encapsulated variables.  Oh and it has to be as reliable as possible.  :ph34r:

I'm not really sure about this but here's what I think: ControlSend does not simulate keypresses. So it does not have the drawback of simulating to press the key down, then release the first key, press the next key down, release the second key...

Instead it simply tells windows: "Send the following keys to the specified control".

Edited by sugi

Share this post


Link to post
Share on other sites

I'm not really sure about this but here's what I think: ControlSend does not simulate keypresses. So it does not have the drawback of simulating to press the key down, then release the first key, press the next key down, release the second key...

Instead it simply tells windows: "Send the following keys to the specified control".

Send() is a very low level function that simulates the actual keypresses on the keyboard. Eventually windows turns these keypresses into windows messages that it sends to the message queue of a window

ControlSend() creates and sends the windows messages directly to a windows message queue (key up/key down type messages)

ControlSetText() Just sends a single "change your text to this" message

The fewer messages sent, the less chance of things going wrong.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0