Sending F-Keys to server (General questions)
I am testing the ssh product connecting to remote control a server app. All is well and I can send key strokes and get responses.
The issue at hand is I need to send some F keys to trigger the host menus. The first one I need to hit is F10.
Can someone please help me with the send command to accomplish this.
Thanks.
Sample connect code:
Dim WithEvents oSSH As WeOnlyDo.Client.SSH
Sub Main()
Dim sKey As String =
oSSH = New WeOnlyDo.Client.SSH
'Set login params
With oSSH
.Login = superman
.Password = strongpassword
.Encryption = Client.SSH.EncryptionMethods.Auto
.Protocol = Client.SSH.SupportedProtocols.SSHAuto
.StripANSI = True
.TerminalType = vt100
.Connect( 10.25.13.29 )
End With
...
Re: Sending F-Keys to server
Hi Bill,
You can send an F10 sequence by using a code similiar to this:
[code]Ssh1.Send(Chr(27) & [21~ )[/code]
This will send the F10 key to the server. However, please note that this line possibly won't work with TerminalType set to vt100 . If this happens, you should set TerminalType to linux .
Hope this helps.
Regards,
Damba
Re: Sending F-Keys to server
That did it.
Thanks for the help!
Bill[:smile:]
Re: Sending F-Keys to server
So close and yet so far.
The code you put works, thanks again.
I figured for the next step where I had to push in F2 and F4, I could just walk the number down from 21 and be ok.
That doesn't seem to work in xterm or vt100.
Is there something special about the lower end F-keys?
Thanks.
Bill
Re: Sending F-Keys to server
Bill,
Can you please try this:
F1
ssh1.Send (Chr(27) + OP )
F2
ssh1.Send (Chr(27) + OQ )
F3
ssh1.Send (Chr(27) + OR )
F4
ssh1.Send (Chr(27) + OS )
F5
ssh1.Send (Chr(27) + OT )
F6
ssh1.Send (Chr(27) + OU )
F7
ssh1.Send (Chr(27) + OV )
F8
ssh1.Send (Chr(27) + OW )
F9
ssh1.Send (Chr(27) + OX )
F11
ssh1.Send (Chr(27) + OZ )
F12
ssh1.Send (Chr(27) + O[ )
Drazen
Re: Sending F-Keys to server
Did you figure that later I was going to ask for the other keys? [:smile:]
This worked. I'll have to wrap my brain around why but at least I can continue with my proof of concept.
The tool works great so far but I'm sold on the support alone already.
Thanks for the help!
Bill