Jump to content

Send Control Characters To Console (?unicode Console?)


Recommended Posts

Given one putty console (plink to be correct). The console is probably unicode (at least UTF-8 is specified in putty session options).

The task is to send ctrl-c to close window or ctrl-d command to logout from remote shell.

Problem: control codes typed from keyboard are transmitted correctly, but with AutoIt v3.1.1 Send() function they don't seem to work at all.

start "plink" plink session

This opens a new console window to remote shell. And then.

WinActivate("plink")
WinWaitActive("plink")
Send("{ASC 0067}")
Send("+{ASC 67}")
Send("!{ASC 67}")
Send("^{ASC 67}")
Send("+{ASC 0067}")
Send("!{ASC 0067}")
Send("^{ASC 0067}")
;Send("{CTRLBREAK}")
Send("{ASC 0013}")

This gives a string

[serv001]$ CCCCCCC
-bash: CCCCCCC: command not found
[serv001]$
Link to comment
Share on other sites

HI,

I cannot test it right now. Just a thought. Try ClipPut and right mouse.

So long,

Mega

P.S.: I know that even when it should work, it is now good solution. :">

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

HI,

I cannot test it right now. Just a thought. Try ClipPut and right mouse.

So long,

Mega

P.S.: I know that even when it should work, it is now good solution. :">

Well, ControlClick("plink", "", "", "right") works fine to paste text into the window in this case. The problem is how to get "ctrl+c" to clipboard. =) Any ideas?

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...