using type("foo bar") does not type the text into remote desktop window

Asked by Jeremy J Swartwood

When using Remote Desktop Connection or Remote Desktop Connection Manager, typing does not work.

I can do click("image.png") and it works
However, if I use type("text") nothing will show up.

Even if I open notepad on the remote computer, put a 5 second pause in, click run, then click inside notepad on the remote machine, no text appears.

Log output says sikulix typed the message however.

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

might be a focus problem.
Take care, that the RDC window is activated, when the type() is done.

Revision history for this message
Jeremy J Swartwood (kaltinril) said :
#2

Yes, focus is definitely on the RDC window.

I would have a two line script like this:
wait(5)
type("abc")

Then I would click run in slow motion.

I would then click inside a notepad window I had open in the remote desktop session to make sure focus is there.
I would then type a letter every few seconds "h....h.......h..........h...........h" to verify focus is there
Eventually the 5 seconds would be up, and no "abc" shows up, but sikulix says it typed abc.

I was reading around some someone said RDC might be blocking the key input because it's not actually coming from a keyboard?

Revision history for this message
RaiMan (raimund-hocke) said :
#3

If focus is at the window, then on Windows not getting the typed characters into the window usually is indeed due to blocking of non keyboard input.

You might try to start the RD session from a command line in admin mode (normally the way, to unblock)

Another option is to try with paste() after having allowed pasting (ctrl-v) from the host to the RD window.

Revision history for this message
Jeremy J Swartwood (kaltinril) said :
#4

Ok, my real job duties blocked me again. I apologize.

I tried paste and I also tried starting remote desktop connection from a command prompt in administrative mode, neither accepted type or paste from sikulix.

Have you tried this before? Do you know if it is supposed to work?

Revision history for this message
Jeremy J Swartwood (kaltinril) said :
#5

This talks about rdp blocking it.

https://stackoverflow.com/questions/1138606/alternative-to-sendkeys-when-running-over-remote-desktop

and another

https://social.msdn.microsoft.com/Forums/en-US/01d1c501-880a-48c3-8b82-d3b08e974ff0/remote-desktop-connection-sendkeys?forum=Vsexpressvb

I looked into how you are sending keys and it's through sendinput, which is one of the suggested ways. So I'm confused why its not working.

from [API/src/main/java/org/sikuli/script/support/RobotDesktop.java]
User32.INSTANCE.SendInput(new WinDef.DWORD(1),
          (WinUser.INPUT[]) input.toArray(1), input.size());

Revision history for this message
Jeremy J Swartwood (kaltinril) said :
#6

Ah, perhaps it's taking the normal path and calling keyPress method from the java.awt.Robot class instead.

Who knows how that's implemented though.

Long and short of it is. Doesn't seem like I'll be able to run Sikulix on my laptop, and send keyboard input over to the remote desktop computer.

Revision history for this message
RaiMan (raimund-hocke) said :
#7

Ok, I will check, but may take a while.
Other priorities currently.

I will report here.

Can you help with this problem?

Provide an answer of your own, or ask Jeremy J Swartwood for more information if necessary.

To post a message you must log in.