Knowledgebase
Sending CTRL+A-CTRL+H, F1-F12 and other function keys to telnet server.
Posted by Van Glass on 15 March 2007 10:57 PM
To send a CTRL+D sequence you must send the octal value 004 to the Telnet server. An example of this is provided in the code below.

TelnetOutputStream output = telnet.GetOutputStream();
string CTRLD = "\004";
output.twrite(Encoding.ASCII.GetBytes(CTRLD));


Where telnet is an instance of the Telnet class and the TelnetOutputStream#twrite method is used which sends the CTRL+D sequence to the Telnet server.

Below are the key mapping for other function strings that can be sent to the telnet server.

F1 \033[11~
F2 \033[12~
F3 \033[13~
F4 \033[14~
F5 \033[15~
F6 \033[17~
F7 \033[18~
F8 \033[19~
F9 \033[20~
F10 \033[21~
F11 \033[23~
F12 \033[24~
F13 \033[25~
F14 \033[26~
F15 \033[28~
F16 \033[29~
F17 \033[31~
F18 \033[32~
F19 \033[33~
F20 \033[34~

Shift+F1 \033[25~
Shift+F2 \033[26~
Shift+F3 \033[28~
Shift+F4 \033[29~
Shift+F5 \033[31~
Shift+F6 \033[32~
Shift+F7 \033[33~
Shift+F8 \033[34~

Ctrl+A \001
Ctrl+B \002
Ctrl+C \003
Ctrl+D \004
Ctrl+E \005
Ctrl+F \006
Ctrl+G \007
Ctrl+H \008

Cursor Up \033[A~
Cursor Down \033[B~
Cursor Forward \033[C~
Cursor Backward \033[D~



(170 vote(s))
This article was helpful
This article was not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
Help Desk Software by Kayako fusion