Sending F-Keys to server - WeOnlyDo Discussion board

Sending F-Keys to server (General questions)

by Bill Deihl, Tuesday, March 11, 2008, 20:33 (6104 days ago)

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

by wodDamir, Tuesday, March 11, 2008, 23:39 (6104 days ago) @ Bill Deihl

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

by Bill Deihl, Wednesday, March 12, 2008, 14:23 (6103 days ago) @ wodDamir

That did it.

Thanks for the help!

Bill[:smile:]

Re: Sending F-Keys to server

by Bill Deihl, Wednesday, March 12, 2008, 19:15 (6103 days ago) @ Bill Deihl

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

by woddrazen, Wednesday, March 12, 2008, 19:19 (6103 days ago) @ Bill Deihl

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

by Bill Deihl, Wednesday, March 12, 2008, 19:26 (6103 days ago) @ woddrazen

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