Sign in to follow this  
Followers 0
kenneal

Case problem in ControlSend()

10 posts in this topic

I've been using Controlsend for multi tasking purposes such as when I am surfing the internet I use it to do some other stuff.

Controlsend("Kitwork", "", "", "Etc etc: "& $ctext &" {enter}")

But sometimes i realise my $ctext is for e.g. - Hi how are you doing - ?

It appears sometimes as:

hI hOw aRe yOu DoinG - /

Hi HoW ARE yoU doInG _ ?

Hi hoW ARE yoU DoinG - ?

(as if the shift button was triggered..)

While there appears to be no missing letters at the moment, is there any way to fix it?

:whistle:

Share this post


Link to post
Share on other sites



ControlSetText() might be better suited to the job depending on a few different factors. Give it a go and see if it's what you're after.

Share this post


Link to post
Share on other sites

I tried ControlSetText, unfortunately it only changes the title of the window.. Any other solutions as to how to make sure the case doesnt change?

Share this post


Link to post
Share on other sites

You could use ClipPut() to copy the desired text to the clipboard, and then:

ControlSend("Kitwork", "", "", "^v")

Does that work for you?

Share this post


Link to post
Share on other sites

*bump*

Nope that doesnt work. Oddly enough, does anybody have any sort of solution for this? I really need to differentiate case letters.

As for the method you just suggested,

it just appears as "v" there. I've copied your syntax just to double check, and its still the same thing.

Please help ;)

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

*bump*

Nope that doesnt work. Oddly enough, does anybody have any sort of solution for this? I really need to differentiate case letters.

As for the method you just suggested,

it just appears as "v" there. I've copied your syntax just to double check, and its still the same thing.

Please help  ;)

<{POST_SNAPBACK}>

i've got an idea that will make it work, give me a few minutes and i'll add the code to this post....

***edit*** try this code...

$thestring = "Hi how are you?"
$theletters = StringSplit($thestring,"")
for $x = 1 to $theletters[0]
     Send(Chr(Asc($theletters[$x])))
 Next
Edited by cameronsdad

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

There no solution in AutoIt to send characters without interference with the Capslock on/off

The only possibility is to minimize the delay between keystroke using Opt('sendkeydelay',0) and Opt('SendKeyDownDelay',0) :">

Opt("SendKeyDelay", 250)
Run("Notepad")
WinWaitActive("Untitled -")
$cText="Hi how are you doing - ?"

Controlsend("Untitled -", "", "Edit1", "Etc etc: "& $ctext &" {enter}")
Sleep(2000)

Opt("SendKeyDelay", 0)
Opt("SendKeyDownDelay", 0)
Controlsend("Untitled -", "", "Edit1", "Etc etc: "& $ctext &" {enter}")

Share this post


Link to post
Share on other sites

There no solution in AutoIt to send characters without interference with the Capslock on/off

The only possibility is to minimize the delay between keystroke using Opt('sendkeydelay',0) and Opt('SendKeyDownDelay',0) :">

Opt("SendKeyDelay", 250)
Run("Notepad")
WinWaitActive("Untitled -")
$cText="Hi how are you doing - ?"

Controlsend("Untitled -", "", "Edit1", "Etc etc: "& $ctext &" {enter}")
Sleep(2000)

Opt("SendKeyDelay", 0)
Opt("SendKeyDownDelay", 0)
Controlsend("Untitled -", "", "Edit1", "Etc etc: "& $ctext &" {enter}")

<{POST_SNAPBACK}>

actually, the method i listed works regardless of capslock since it is explicity sending the characters intended....i've tested it a few times (the modified that i just updated)

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

actually, the method i listed works regardless of capslock since it is explicity sending the characters intended....i've tested it a few times (the modified that i just updated)

<{POST_SNAPBACK}>

Your method can work just because that your sending one chareacter at a time just because AutoIt reset the capslock state a the end of the send so you have very few chance to be in conflict with an external keystroking of the capslock button.

;)

Share this post


Link to post
Share on other sites

Your method can work just because that your sending one chareacter at a time just because AutoIt reset the capslock state a the end of the send so you have very few chance to be in conflict with an external keystroking of the capslock button.

:P

<{POST_SNAPBACK}>

i thought it worked because Chr(65) is an uppercase A regardless of the caps lock state... ;)

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

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