0 votes
by (120 points)

I've got a terminal that I'm trying to screen scrape that has P1 mapped to the num lock key on a windows machine, I don't see P1 anywhere in the function keys. I'm trying to figure out how to replicate what the user is doing.

1 Answer

0 votes
by (15.2k points)
edited by

Hi,

Keys that are not letters or numbers almost always send some code string (mostly in form of escape sequence) to the server. You need to know which escape sequence is send to the server when the mapped key (in your case NumLock) is pressed.

According to this article, it seems you want to send PF1 key, which is SS3 P (ESC O P) escape sequence, which is the same as F1 function key with default options set in our terminal.

So, to send PF1 key (SS3 P), just press F1 key on Windows keyboard.

Alternatively, you can send the escape sequence to the server programmaticaly by calling:

terminal.Scripting.Send(FunctionKey.F1);

If it does not help, please let us know.

by (120 points)
That is exactly what I needed, thank you.
by (15.2k points)
You are welcome.
...