<\#9>KEYCODE.EXE for Tera Term <\#9>T. Teranishi <\#9> <\#9>Copyright (C) 1994-1998 T. Teranishi <\#9>All Rights Reserved. KEYCODE.EXE is a utility which displays key codes used in the Tera Term's keyboard setup file. This text describes the usage of KEYCODE.EXE and the format of keyboard setup file. Please read this text and Tera Term help for changing the keyboard configuration. Please do not ask the author questions about the keyboard configuration. ------------------------------------------------------------------------------- 1. INSTALLATION If you are using Windows 3.1 or NT 3.X, install KEYCODE.EXE in Program Manager with its icon. If you are using Windows 95 or Windows NT 4.0, create a shortcut for KEYCODE.EXE in a folder of your choice, in the Start menu or on the desktop. ------------------------------------------------------------------------------- 2. USAGE When you run KEYCODE.EXE, the message "Push any key" will be displayed in the window.<\#9>When you press a key or a combination of keys (such as Ctrl+key), the message "Key code is XXXX." will be displayed. XXXX is a decimal number. ------------------------------------------------------------------------------- 3. ABOUT THE KEYBOARD SETUP FILE The keyboard setup file assigns keys on PC keyboard for various functions such as VT terminal functions, sending user defined character strings, executing Tera Term commands and executing macro files. The default keyboard setup stored in the file KEYBOARD.CNF is almost compatible with VT terminal keyboard. You can modify key assignments by editing the file. The file name of keyboard setup file to be loaded by Tera Term can be specified as a command line parameter of Tera Term (see Tera Term help). If you omit the file name extension, the default extension ".CNF" is used. If you omit the file name, the default file KEYBOARD.CNF is loaded. ............................................................................... 3.1 FORMAT OF THE KEYBOARD SETUP FILE Each key or key combination has a unique key code, which is called "PC key code". The keyboard setup file has six sections: [VT editor keypad], [VT numeric keypad], [VT function keys], [X function keys], [Shortcut keys] and [User keys]. 1) [VT editor keypad] section In this section, VT editor keys are assigned to PC keys. <\#9>Format: <\#9><\#9>= <\#9>where: <\#9> <\#9><\#9>Up, Down, Right, Left, Find, Insert, Remove, Select, <\#9><\#9>Prev, Next <\#9> <\#9><\#9>PC key code (decimal number) <\#9>Example: <\#9><\#9>Up=328 2) [VT numeric keypad] section In this section, VT numeric keys are assigned to PC keys. <\#9>Format: <\#9><\#9>= <\#9>where: <\#9> <\#9><\#9>Num0, Num1, Num2, Num3, Num4, Num5, Num6, Num7, Num8, <\#9><\#9>Num9, NumMinus, NumComma, NumPeriod, NumEnter, PF1, <\#9><\#9>PF2, PF3, PF4 <\#9> <\#9><\#9>PC key code (decimal number) <\#9>Example: <\#9><\#9>Num0=82 3) [VT function keys] section In this section, VT function keys are assigned to PC keys. <\#9>Format: <\#9><\#9>= <\#9>where: <\#9> <\#9><\#9>(Function keys of VT terminal) <\#9><\#9>Hold, Print, Break, F6, F7, F8, F9, F10, F11, F12, <\#9><\#9>F13, F14, Help, Do, F17, F18, F19, F20 <\#9><\#9>("User defined keys" of VT terminal) <\#9><\#9>UDK6, UDK7, UDK8, UDK9, UDK10, UDK11, UDK12, UDK13, <\#9><\#9>UDK14, UDK15, UDK16, UDK17, UDK18, UDK19, UDK20 <\#9> <\#9><\#9>PC key code (decimal number) <\#9>Example: <\#9><\#9>F6=64 4) [X function keys] section In this section, Xterm F1-F5 keys are assigned to PC keys. <\#9>Format: <\#9><\#9>= <\#9>where: <\#9> <\#9><\#9>XF1, XF2, XF3, XF4, XF5 <\#9> <\#9><\#9>PC key code (decimal number) <\#9>Example: <\#9><\#9>XF1=59 5) [Shortcut keys] section In this section, Tera Term functions are assigned to PC keys. <\#9>Format: <\#9><\#9>= <\#9>where: <\#9> <\#9>Function <\#9> -------------------------------------------- <\#9> EditCopy<\#9><\#9>[Edit] Copy command <\#9> EditPaste<\#9><\#9>[Edit] Paste command <\#9> EditPasteCR<\#9><\#9>[Edit] Paste command <\#9> EditCLS<\#9><\#9>[Edit] Clear screen command <\#9> EditCLB<\#9><\#9>[Edit] Clear buffer command <\#9> ControlOpenTEK<\#9>[Control] Open TEK command <\#9> ControlCloseTEK<\#9>[Control] Close TEK command <\#9> LineUp<\#9><\#9>Scrolls up screen by 1 line <\#9> LineDown<\#9><\#9>Scrolls down by 1 line <\#9> PageUp<\#9><\#9>Scrolls up by 1 page <\#9> PageDown<\#9><\#9>Scrolls down by 1 page <\#9> BuffTop<\#9><\#9>Scrolls screen to buffer top <\#9> BuffBottom<\#9><\#9>Scrolls screen to buffer bottom <\#9> NextWin<\#9><\#9>Moves to the next Tera Term window <\#9> PrevWin<\#9><\#9>Moves to the previous Tera Term window <\#9> LocalEcho<\#9><\#9>Toggles the local echo status <\#9> <\#9><\#9>PC key code (decimal number) <\#9>Example: <\#9><\#9>LineUp=1352 6) [User keys] section This section defines user keys for functions, sending a character string, executing a macro file or executing a menu command. <\#9>Format: <\#9><\#9>=,, <\#9><\#9><\#9><\#9> <\#9>where: <\#9> <\#9><\#9>User1, User2, User3,...., User99 <\#9><\#9>Maximum number of user keys is 99. <\#9><\#9>For example, if you want to define ten user keys, <\#9><\#9>you must use the first ten names, from "User1" to "User10". <\#9> <\#9><\#9>PC key code (decimal number) <\#9> <\#9><\#9>Control flag which specifies how <\#9><\#9>is treated when the PC key is pressed. <\#9><\#9><\#9>0<\#9> is sent as it is. <\#9><\#9><\#9>1<\#9>New-line codes in <\#9><\#9><\#9><\#9>are converted by Tera Term and <\#9><\#9><\#9><\#9>the converted string is sent. <\#9><\#9><\#9>2<\#9>A macro file which has the name of <\#9><\#9><\#9><\#9> is executed. <\#9><\#9><\#9>3<\#9>A Tera Term menu command specified <\#9><\#9><\#9><\#9>by the menu ID is <\#9><\#9><\#9><\#9>executed. <\#9> <\#9><\#9>If is 0 or 1, <\#9><\#9>represents the character string to be sent. <\#9><\#9>A non-printable character (control character) in <\#9><\#9>the string can be expressed as a "$" and ASCII code <\#9><\#9>in two-character hex number. For example, CR character <\#9><\#9>is expressed as "$0D". "$" itself is expressed as "$24". <\#9><\#9>See "Appendix A ASCII CODE TABLE". <\#9><\#9>If is 2, specifies <\#9><\#9>the macro file name to be executed. <\#9><\#9>If is 3, is the menu <\#9><\#9>ID which specifies the menu command to be executed. <\#9><\#9>The menu ID should be expressed as a decimal number. <\#9><\#9>See "Appendix B LIST OF MENU IDs". <\#9>Example: <\#9><\#9>User1=1083,0,telnet myhost <\#9><\#9>User2=1084,0,$0D$0A <\#9><\#9>User3=1085,1,$0D <\#9><\#9>User4=1086,2,test.ttl <\#9><\#9>User5=1087,3,50110 ............................................................................... 3.2 NOTE You can use a PC key code only once in the setup file. If you use a PC key code for multiple key assignments, the warning message "Key code XXX is used more than once" is displayed when the file is loaded by Tera Term. In this case, one of the assignments becomes effective and others are ignored. If you don't want to assign a key item to any PC key, use the word "off" like the following: EditCopy=off ............................................................................... 3.3 KEY COMBINATIONS The following key combinations are acceptable to Tera Term and KEYCODE.EXE: <\#9>Shift+key <\#9>Ctrl+key <\#9>Shift+Ctrl+key <\#9>Shift+Alt+key <\#9>Ctrl+Alt+key <\#9>Shift+Ctrl+Alt+key Since some combinations (such as Alt+key) are used as shortcut keys of Tera Term and Windows, they don't have PC key codes and can't be specified in the keyboard setup file. ............................................................................... 3.4 Q & A If you are in trouble with the keyboard configuration, please read this text and Tera Term help carefully. Please do not ask the author questions about the keyboard configuration. Q. Everytime I run Tera Term, the warning message "Key code XXX is used more than once" is displayed. A. See "3.2 NOTE". Q. I want to use the PC "F1" key as the VT100 PF1 key. I edit the keyboard setup file like the following but it does not work: [VT function keys] F1=PF1<\#9><\#9>(This is wrong.) A. The left hand side can not be the name of a **PC key** but the name of a **VT terminal key**. The right hand side can not be the name of a key but a PC key code. See "3.1 FORMAT OF THE KEYBOARD SETUP FILE". You should also be careful not to specify a PC key code more than once in the setup file (see "3.2 NOTE"). Edit the keyboard setup file like the following: [VT function keys] PF1=59<\#9><\#9><\#9>(59 is the keycode for the F1 key.) [X function keys] ;XF1=59<\#9><\#9><\#9>(Avoid specifying 59 twice.) XF1=off<\#9><\#9><\#9>(Replace 59 by "off".) Q. How to edit the keyboard setup file to assign the F1 key for sending the escape sequence "ESC [ A"? A. You can send any character string by using a user key. See "3.1 FORMAT OF THE KEYBOARD SETUP FILE". You should also be careful not to specify a PC keycode more than once in the setup file (see "3.2 NOTE"). Edit the keyboard setup file like the following: [X function keys] ;XF1=59<\#9><\#9><\#9>(59 is the keycode for the F1 key.) <\#9><\#9><\#9><\#9>(Avoid specifying 59 twice.) XF1=off<\#9><\#9><\#9>(Replace 59 by "off".) [User keys] User1=59,0,$1B[A<\#9><\#9>(The ASCII code for ESC is $1B.) ------------------------------------------------------------------------------- APPENDIX A<\#9>ASCII CODE TABLE (HEXADECIMAL REPRESENTATION) For example, the ASCII code for "A" is $41. ------------------------------------------------------------ Char<\#9> Code | Char<\#9>Code | Char Code | Char Code | ------------------------------------------------------------ NUL (^@) $00 | DLE (^P) $10 | SPACE<\#9>$20 | 0 $30 | SOH (^A) $01 | DC1 (^Q) $11 | !<\#9>$21 | 1 $31 | STX (^B) $02 | DC2 (^R) $12 | "<\#9>$22 | 2 $32 | ETX (^C) $03 | DC3 (^S) $13 | #<\#9>$23 | 3 $33 | EOT (^D) $04 | DC4 (^T) $14 | $<\#9>$24 | 4 $34 | ENQ (^E) $05 | NAK (^U) $15 | %<\#9>$25 | 5 $35 | ACK (^F) $06 | SYN (^V) $16 | &<\#9>$26 | 6 $36 | BEL (^G) $07 | ETB (^W) $17 | '<\#9>$27 | 7 $37 | BS (^H) $08 | CAN (^X) $18 | (<\#9>$28 | 8 $38 | HT (^I) $09 | EM (^Y) $19 | )<\#9>$29 | 9 $39 | LF (^J) $0A | SUB (^Z) $1A | *<\#9>$2A | : $3A | VT (^K) $0B | ESC (^[) $1B | +<\#9>$2B | ; $3B | FF (^L) $0C | FS (^\) $1C | ,<\#9>$2C | < $3C | CR (^M) $0D | GS (^]) $1D | -<\#9>$2D | = $3D | SO (^N) $0E | RS (^^) $1E | .<\#9>$2E | > $3E | SI (^O) $0F | US (^_) $1F | /<\#9>$2F | ? $3F | ------------------------------------------------------------ Char<\#9> Code | Char<\#9>Code | Char Code | Char Code | ------------------------------------------------------------ @<\#9> $40 | P<\#9> $50 | `<\#9>$60 | p $70 | A<\#9> $41 | Q<\#9> $51 | a<\#9>$61 | q $71 | B<\#9> $42 | R<\#9> $52 | b<\#9>$62 | r $72 | C<\#9> $43 | S<\#9> $53 | c<\#9>$63 | s $73 | D<\#9> $44 | T<\#9> $54 | d<\#9>$64 | t $74 | E<\#9> $45 | U<\#9> $55 | e<\#9>$65 | u $75 | F<\#9> $46 | V<\#9> $56 | f<\#9>$66 | v $76 | G<\#9> $47 | W<\#9> $57 | g<\#9>$67 | w $77 | H<\#9> $48 | X<\#9> $58 | h<\#9>$68 | x $78 | I<\#9> $49 | Y<\#9> $59 | I<\#9>$69 | y $79 | J<\#9> $4A | Z<\#9> $5A | j<\#9>$6A | z $7A | K<\#9> $4B | [<\#9> $5B | k<\#9>$6B | { $7B | L<\#9> $4C | \<\#9> $5C | l<\#9>$6C | | $7C | M<\#9> $4D | ]<\#9> $5D | m<\#9>$6D | } $7D | N<\#9> $4E | ^<\#9> $5E | n<\#9>$6E | ~ $7E | O<\#9> $4F | _<\#9> $5F | o<\#9>$6F | DEL $7F | ------------------------------------------------------------ ............................................................................... APPENDIX B<\#9>LIST OF MENU IDs See "3.1 FORMAT OF THE KEYBOARD SETUP FILE" for specifying a menu ID. Menu IDs may be changed in future. 1) VT window Menu command<\#9><\#9><\#9>ID ------------------------------------- [File] New connection<\#9><\#9>50110 [File] Log<\#9><\#9><\#9>50120 [File] Send file<\#9><\#9>50130 [File] Transfer/Kermit/Receive<\#9>50141 [File] Transfer/Kermit/Get<\#9>50142 [File] Transfer/Kermit/Send<\#9>50143 [File] Transfer/Kermit/Finish<\#9>50144 [File] Transfer/XMODEM/Receive<\#9>50145 [File] Transfer/XMODEM/Send<\#9>50146 [File] Transfer/ZMODEM/Receive<\#9>50151 [File] Transfer/ZMODEM/Send<\#9>50152 [File] Transfer/B-Plus/Receive<\#9>50153 [File] Transfer/B-Plus/Send<\#9>50154 [File] Transfer/Quick-VAN/Receive 50155 [File] Transfer/Quick-VAN/Send<\#9>50156 [File] Change dir<\#9><\#9>50170 [File] Print<\#9><\#9><\#9>50180 [File] Disconnect<\#9><\#9>50190 [File] Exit<\#9><\#9><\#9>50199 [Edit] Copy<\#9><\#9><\#9>50210 [Edit] Copy table<\#9><\#9>50220 [Edit] Paste<\#9><\#9><\#9>50230 [Edit] PasteCR<\#9><\#9><\#9>50240 [Edit] Clear screen<\#9><\#9>50250 [Edit] Clear buffer<\#9><\#9>50260 [Setup] Terminal<\#9><\#9>50310 [Setup] Window<\#9><\#9><\#9>50320 [Setup] Font<\#9><\#9><\#9>50330 [Setup] Keyboard<\#9><\#9>50340 [Setup] Serial port<\#9><\#9>50350 [Setup] TCPIP<\#9><\#9><\#9>50360 [Setup] General <\#9><\#9>50370 [Setup] Save setup<\#9><\#9>50380 [Setup] Restore setup<\#9><\#9>50390 [Setup] Load key map<\#9><\#9>50395 [Control] Reset terminal<\#9>50410 [Control] Are you there <\#9>50420 [Control] Send break<\#9><\#9>50430 [Control] Reset port<\#9><\#9>50440 [Control] Open TEK<\#9><\#9>50450 [Control] Close TEK<\#9><\#9>50460 [Control] Macro <\#9><\#9>50470 [Window] Window <\#9><\#9>50810 [Help] Index<\#9><\#9><\#9>50910 [Help] Using<\#9><\#9><\#9>50920 [Help] About<\#9><\#9><\#9>50990 2) TEK window Menu command<\#9><\#9><\#9>ID ------------------------------------- [File] Print<\#9><\#9><\#9>51110 [File] Exit<\#9><\#9><\#9>51190 [Edit] Copy<\#9><\#9><\#9>51210 [Edit] Copy screen<\#9><\#9>51220 [Edit] Paste<\#9><\#9><\#9>51230 [Edit] PasteCR<\#9><\#9><\#9>51240 [Edit] Clear Screen<\#9><\#9>51250 [Setup] Window<\#9><\#9><\#9>51310 [Setup] Font<\#9><\#9><\#9>51320 [VTWin] <\#9><\#9><\#9>51410 [Window] Window <\#9><\#9>50810 [HELP] Index<\#9><\#9><\#9>51910 [HELP] Using<\#9><\#9><\#9>51920 [HELP] About<\#9><\#9><\#9>51990