How to write a controlkey to an open process

I would like send a controlkey + a right square bracket to an open process. I am using the following but it does not seem to work.


write contolKey & "]" to process "/bin/bash#id" & n
read from process "/bin/bash#id" & n until end

Anybody have an idea?

Hmm, no, that won’t work. ControlKey and the other special codes only work with the TypeText command to simulate pressing those keys on the SUT. An open process is basically a pipe to another process through which you can pass text as bytes. I’m not sure how to send a modifier key there… I hadn’t thought about it before. :? I’ll do some poking around and let you know if I figure anything out.

Anyone else have ideas about this?

The ASCII code for Ctrl-] is actually the “Group Separator” character - 1D in Hex or 29 in decimal.

So to write that to a process you should use NumToChar(29).

Of course! I knew that! :oops: I just get so used to thinking in Eggplant’s event terms that I forgot to think in terms of the obvious – that Ctrl-] is just a way to type that particular character, so you don’t actually need to send the control key, just the character it produces (which BTW should also be the same as Ctrl-= or controlKey + equals, I believe).

Thanks for your help!