ControlSendRaw sometimes sends wrong characters, as if SHIFT is pressed

Report problems with documented functionality
Hadakajime
Posts: 2
Joined: 21 Jun 2017, 23:34

ControlSendRaw sometimes sends wrong characters, as if SHIFT is pressed

21 Jun 2017, 23:54

V1.1.26.00

I wrote a script to input the proxy script address in the Internet Properties control panel on Windows 10
It includes the following statement:

Code: Select all

WinWaitActive,Local Area Network (LAN) Settings
ControlSendRaw,Edit1,http://wpad/wpad.dat
However, sometimes the result in the field is:

Code: Select all

http:?/wpad/wpad.dat
If I keep trying to run the script, it works about 50% of the time. I found other characters that exhibits the same anomaly:

Code: Select all

\
:
The erroneous results are:

Code: Select all

|
;
It kind of appears to relate to the SHIFT key being inadvertently simulated. I ran the test for 30 consecutive runs and here are my results:

Code: Select all

http://wpad/wpad.dat
http://wpad/wpad.dat
http://wpad/wpad.dat
http;//wpad/wpad.dat
http:?/wpad/wpad.dat
http://wpad/wpad.dat
http://wpad/wpad.dat
http://wpad/wpad.dat
http://wpad/wpad.dat
http://wpad/wpad.dat
http://wpad/wpad.dat
http;?/wpad/wpad.dat
http:?/wpad/wpad.dat
http;?/wpad/wpad.dat
http://wpad/wpad.dat
http;?/wpad/wpad.dat
http://wpad/wpad.dat
http;?/wpad/wpad.dat
http:?/wpad/wpad.dat
http:?/wpad/wpad.dat
http://wpad/wpad.dat
http;//wpad/wpad.dat
http;//wpad/wpad.dat
http;//wpad/wpad.dat
http://wpad/wpad.dat
http;?/wpad/wpad.dat
http://wpad/wpad.dat
http;?/wpad/wpad.dat
http;?/wpad/wpad.dat
http;//wpad/wpad.dat
The workaround I have to use is just specify the URL without "http://".
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: ControlSendRaw sometimes sends wrong characters, as if SHIFT is pressed

22 Jun 2017, 01:12

I don't know if this will work for sure, but it might do:

Code: Select all

+q::
BlockInput, On
ControlSend,Edit1,{Shift Up},A
ControlSendRaw,Edit1,http://wpad/wpad.dat,A
BlockInput, Off
return
Btw there are also:

Code: Select all

ControlSetText, Edit1, % vText, A

Control, EditPaste, % vText, Edit1, A

Clipboard := vText
SendInput ^v
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
User avatar
Xtra
Posts: 2750
Joined: 02 Oct 2015, 12:15

Re: ControlSendRaw sometimes sends wrong characters, as if SHIFT is pressed

22 Jun 2017, 01:20

Try using SetKeyDelay and slowing down the duration.
I've seen similar issues with citrix windows.
The value of SetKeyDelay determines the speed at which keys are sent. If the target window does not receive the keystrokes reliably, try increasing the press duration via the second parameter of SetKeyDelay
Hadakajime
Posts: 2
Joined: 21 Jun 2017, 23:34

Re: ControlSendRaw sometimes sends wrong characters, as if SHIFT is pressed

22 Jun 2017, 01:33

Funny if it receives the wrong keys instead of dropping them entirely, but I don't know how it works behind the scenes.

I resolved the issue by changeing to the following command, as suggested:

Code: Select all

ControlSetText,Edit1,http://wpad/wpad.dat
Thanks so much!

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 24 guests