home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1998 September / VPR9809A.ISO / OLS / Windows / ARCHIVE / TTERMP23.ZIP / keycode.tx_ / keycode.tx
Text File  |  1998-03-10  |  14KB  |  419 lines

  1.     KEYCODE.EXE for Tera Term
  2.     T. Teranishi
  3.     
  4.     Copyright (C) 1994-1998 T. Teranishi
  5.     All Rights Reserved.
  6.  
  7. KEYCODE.EXE is a utility which displays key codes used in the
  8. Tera Term's keyboard setup file. This text describes the usage of
  9. KEYCODE.EXE and the format of keyboard setup file.
  10.  
  11. Please read this text and Tera Term help for changing the keyboard
  12. configuration. Please do not ask the author questions about the
  13. keyboard configuration.
  14.  
  15. -------------------------------------------------------------------------------
  16. 1. INSTALLATION
  17.  
  18. If you are using Windows 3.1 or NT 3.X, install KEYCODE.EXE
  19. in Program Manager with its icon. If you are using Windows 95
  20. or Windows NT 4.0, create a shortcut for KEYCODE.EXE in a folder
  21. of your choice, in the Start menu or on the desktop.
  22.  
  23. -------------------------------------------------------------------------------
  24. 2. USAGE
  25.  
  26. When you run KEYCODE.EXE, the message "Push any key" will be displayed
  27. in the window.    When you press a key or a combination of keys (such as
  28. Ctrl+key), the message "Key code is XXXX." will be displayed. XXXX is a
  29. decimal number.
  30.  
  31. -------------------------------------------------------------------------------
  32. 3. ABOUT THE KEYBOARD SETUP FILE
  33.  
  34. The keyboard setup file assigns keys on PC keyboard for various functions
  35. such as VT terminal functions, sending user defined character strings,
  36. executing Tera Term commands and executing macro files.
  37.  
  38. The default keyboard setup stored in the file KEYBOARD.CNF is almost
  39. compatible with VT terminal keyboard. You can modify key assignments
  40. by editing the file.
  41.  
  42. The file name of keyboard setup file to be loaded by Tera Term can be
  43. specified as a command line parameter of Tera Term (see Tera Term help).
  44. If you omit the file name extension, the default extension ".CNF" is used.
  45. If you omit the file name, the default file KEYBOARD.CNF is loaded.
  46.  
  47. ...............................................................................
  48. 3.1 FORMAT OF THE KEYBOARD SETUP FILE
  49.  
  50. Each key or key combination has a unique key code, which is called
  51. "PC key code". 
  52.  
  53. The keyboard setup file has six sections:  [VT editor keypad],
  54. [VT numeric keypad], [VT function keys], [X function keys], [Shortcut keys]
  55. and [User keys].
  56.  
  57. 1) [VT editor keypad] section
  58. In this section, VT editor keys are assigned to PC keys.
  59.  
  60.     Format:
  61.         <VT editor key name>=<PC key code>
  62.  
  63.     where:
  64.  
  65.     <VT editor key name>
  66.         Up, Down, Right, Left, Find, Insert, Remove, Select,
  67.         Prev, Next
  68.  
  69.       <PC key code>
  70.         PC key code (decimal number)
  71.  
  72.     Example:
  73.         Up=328
  74.  
  75. 2) [VT numeric keypad] section
  76. In this section, VT numeric keys are assigned to PC keys.
  77.  
  78.     Format:
  79.         <VT numeric key name>=<PC key code>
  80.  
  81.     where:
  82.  
  83.       <VT numeric key name>
  84.         Num0, Num1, Num2, Num3, Num4, Num5, Num6, Num7, Num8,
  85.         Num9, NumMinus, NumComma, NumPeriod, NumEnter, PF1,
  86.         PF2, PF3, PF4
  87.  
  88.       <PC key code>
  89.         PC key code (decimal number)
  90.  
  91.     Example:
  92.         Num0=82
  93.  
  94. 3) [VT function keys] section
  95. In this section, VT function keys are assigned to PC keys.
  96.  
  97.     Format:
  98.         <VT function key name>=<PC key code>
  99.  
  100.     where:
  101.  
  102.       <VT function key name>
  103.         (Function keys of VT terminal)
  104.         Hold, Print, Break, F6, F7, F8, F9, F10, F11, F12,
  105.         F13, F14, Help, Do, F17, F18, F19, F20
  106.         ("User defined keys" of VT terminal)
  107.         UDK6, UDK7, UDK8, UDK9, UDK10, UDK11, UDK12, UDK13,
  108.         UDK14, UDK15, UDK16, UDK17, UDK18, UDK19, UDK20
  109.  
  110.       <PC key code>
  111.         PC key code (decimal number)
  112.  
  113.     Example:
  114.         F6=64
  115.  
  116. 4) [X function keys] section
  117. In this section, Xterm F1-F5 keys are assigned to PC keys.
  118.  
  119.     Format:
  120.         <Xterm function key name>=<PC key code>
  121.  
  122.     where:
  123.  
  124.       <Xterm function key name>
  125.         XF1, XF2, XF3, XF4, XF5
  126.  
  127.       <PC key code>
  128.         PC key code (decimal number)
  129.  
  130.     Example:
  131.         XF1=59
  132.  
  133. 5) [Shortcut keys] section
  134. In this section, Tera Term functions are assigned to PC keys.
  135.  
  136.     Format:
  137.         <Shortcut key name>=<PC key code>
  138.  
  139.     where:
  140.       <Shortcut key name>    Function
  141.       --------------------------------------------
  142.       EditCopy        [Edit] Copy command
  143.       EditPaste        [Edit] Paste command
  144.       EditPasteCR        [Edit] Paste<CR> command
  145.       EditCLS        [Edit] Clear screen command
  146.       EditCLB        [Edit] Clear buffer command
  147.       ControlOpenTEK    [Control] Open TEK command
  148.       ControlCloseTEK    [Control] Close TEK command
  149.       LineUp        Scrolls up screen by 1 line
  150.       LineDown        Scrolls down by 1 line
  151.       PageUp        Scrolls up by 1 page
  152.       PageDown        Scrolls down by 1 page
  153.       BuffTop        Scrolls screen to buffer top
  154.       BuffBottom        Scrolls screen to buffer bottom
  155.       NextWin        Moves to the next Tera Term window
  156.       PrevWin        Moves to the previous Tera Term window
  157.       LocalEcho        Toggles the local echo status
  158.  
  159.       <PC key code>
  160.         PC key code (decimal number)
  161.  
  162.     Example:
  163.         LineUp=1352
  164.  
  165. 6) [User keys] section
  166. This section defines user keys for functions, sending a character
  167. string, executing a macro file or executing a menu command.
  168.  
  169.     Format:
  170.         <User key name>=<PC key code>,<Control flag>,
  171.                 <Character string>
  172.  
  173.     where:
  174.  
  175.       <User key name>
  176.         User1, User2, User3,...., User99
  177.         Maximum number of user keys is 99. 
  178.         For example, if you want to define ten user keys,
  179.         you must use the first ten names, from "User1" to "User10".
  180.  
  181.       <PC key code>
  182.         PC key code (decimal number)
  183.  
  184.       <Control flag>
  185.         Control flag which specifies how <character string>
  186.         is treated when the PC key is pressed.
  187.             0    <Character string> is sent as it is.
  188.             1    New-line codes in <Character string>
  189.                 are converted by Tera Term and
  190.                 the converted string is sent.
  191.             2    A macro file which has the name of
  192.                 <Character string> is executed.
  193.             3    A Tera Term menu command specified
  194.                 by the menu ID <Character string> is
  195.                 executed.
  196.  
  197.       <Character string>
  198.         If <Control flag> is 0 or 1, <Character string>
  199.         represents the character string to be sent.
  200.         A non-printable character (control character) in
  201.         the string can be expressed as a "$" and ASCII code
  202.         in two-character hex number. For example, CR character
  203.         is expressed as "$0D". "$" itself is expressed as "$24".
  204.         See "Appendix A  ASCII CODE TABLE".
  205.  
  206.         If <Control flag> is 2, <Character string> specifies
  207.         the macro file name to be executed.
  208.  
  209.         If <Control flag> is 3, <Character string> is the menu
  210.         ID which specifies the menu command to be executed.
  211.         The menu ID should be expressed as a decimal number.
  212.         See "Appendix B  LIST OF MENU IDs".
  213.  
  214.     Example:
  215.         User1=1083,0,telnet myhost
  216.         User2=1084,0,$0D$0A
  217.         User3=1085,1,$0D
  218.         User4=1086,2,test.ttl
  219.         User5=1087,3,50110
  220.  
  221. ...............................................................................
  222. 3.2 NOTE
  223.  
  224. You can use a PC key code only once in the setup file.
  225. If you use a PC key code for multiple key assignments,
  226. the warning message "Key code XXX is used more than once" is
  227. displayed when the file is loaded by Tera Term. In this case,
  228. one of the assignments becomes effective and others are ignored.
  229.  
  230. If you don't want to assign a key item to any PC key,
  231. use the word "off" like the following:
  232.  
  233. EditCopy=off
  234.  
  235. ...............................................................................
  236. 3.3 KEY COMBINATIONS
  237.  
  238. The following key combinations are acceptable to Tera Term and KEYCODE.EXE:
  239.  
  240.     Shift+key
  241.     Ctrl+key
  242.     Shift+Ctrl+key
  243.     Shift+Alt+key
  244.     Ctrl+Alt+key
  245.     Shift+Ctrl+Alt+key
  246.  
  247. Since some combinations (such as Alt+key) are used as shortcut keys of
  248. Tera Term and Windows, they don't have PC key codes and can't be specified
  249. in the keyboard setup file.
  250.  
  251. ...............................................................................
  252. 3.4 Q & A
  253.  
  254. If you are in trouble with the keyboard configuration, please
  255. read this text and Tera Term help carefully.
  256. Please do not ask the author questions about the keyboard configuration.
  257.  
  258. Q. Everytime I run Tera Term, the warning message
  259.    "Key code XXX is used more than once" is displayed.
  260. A. See "3.2 NOTE".
  261.  
  262. Q. I want to use the PC "F1" key as the VT100 PF1 key. I edit the 
  263.    keyboard setup file like the following but it does not work:
  264.  
  265.    [VT function keys]
  266.    F1=PF1        (This is wrong.)
  267.  
  268. A. The left hand side can not be the name of a **PC key** but
  269.    the name of a **VT terminal key**. The right hand side can not be
  270.    the name of a key but a PC key code.
  271.    See "3.1 FORMAT OF THE KEYBOARD SETUP FILE".
  272.    You should also be careful not to specify a PC key code more than
  273.    once in the setup file (see "3.2 NOTE").
  274.  
  275.    Edit the keyboard setup file like the following:
  276.  
  277.    [VT function keys]
  278.    PF1=59            (59 is the keycode for the F1 key.)
  279.    [X function keys]
  280.    ;XF1=59            (Avoid specifying 59 twice.)
  281.    XF1=off            (Replace 59 by "off".)
  282.  
  283. Q. How to edit the keyboard setup file to assign the F1 key
  284.    for sending the escape sequence "ESC [ A"?
  285. A. You can send any character string by using a user key.
  286.    See "3.1 FORMAT OF THE KEYBOARD SETUP FILE".
  287.    You should also be careful not to specify a PC keycode more than
  288.    once in the setup file (see "3.2 NOTE").
  289.  
  290.    Edit the keyboard setup file like the following:
  291.  
  292.    [X function keys]
  293.    ;XF1=59            (59 is the keycode for the F1 key.)
  294.                 (Avoid specifying 59 twice.)
  295.    XF1=off            (Replace 59 by "off".)
  296.    [User keys]
  297.    User1=59,0,$1B[A        (The ASCII code for ESC is $1B.)
  298.  
  299. -------------------------------------------------------------------------------
  300. APPENDIX A    ASCII CODE TABLE (HEXADECIMAL REPRESENTATION)
  301.  
  302. For example, the ASCII code for "A" is $41.
  303.  
  304. ------------------------------------------------------------
  305.  Char     Code | Char    Code | Char    Code | Char    Code |
  306. ------------------------------------------------------------
  307.  NUL (^@) $00 | DLE (^P) $10 | SPACE    $20 | 0        $30 |
  308.  SOH (^A) $01 | DC1 (^Q) $11 | !    $21 | 1        $31 |
  309.  STX (^B) $02 | DC2 (^R) $12 | "    $22 | 2        $32 |
  310.  ETX (^C) $03 | DC3 (^S) $13 | #    $23 | 3        $33 |
  311.  EOT (^D) $04 | DC4 (^T) $14 | $    $24 | 4        $34 |
  312.  ENQ (^E) $05 | NAK (^U) $15 | %    $25 | 5        $35 |
  313.  ACK (^F) $06 | SYN (^V) $16 | &    $26 | 6        $36 |
  314.  BEL (^G) $07 | ETB (^W) $17 | '    $27 | 7        $37 |
  315.  BS  (^H) $08 | CAN (^X) $18 | (    $28 | 8        $38 |
  316.  HT  (^I) $09 | EM  (^Y) $19 | )    $29 | 9        $39 |
  317.  LF  (^J) $0A | SUB (^Z) $1A | *    $2A | :        $3A |
  318.  VT  (^K) $0B | ESC (^[) $1B | +    $2B | ;        $3B |
  319.  FF  (^L) $0C | FS  (^\) $1C | ,    $2C | <        $3C |
  320.  CR  (^M) $0D | GS  (^]) $1D | -    $2D | =        $3D |
  321.  SO  (^N) $0E | RS  (^^) $1E | .    $2E | >        $3E |
  322.  SI  (^O) $0F | US  (^_) $1F | /    $2F | ?        $3F |
  323. ------------------------------------------------------------
  324.  Char     Code | Char    Code | Char    Code | Char    Code |
  325. ------------------------------------------------------------
  326.  @      $40 | P     $50 | `    $60 | p        $70 |
  327.  A      $41 | Q     $51 | a    $61 | q        $71 |
  328.  B      $42 | R     $52 | b    $62 | r        $72 |
  329.  C      $43 | S     $53 | c    $63 | s        $73 |
  330.  D      $44 | T     $54 | d    $64 | t        $74 |
  331.  E      $45 | U     $55 | e    $65 | u        $75 |
  332.  F      $46 | V     $56 | f    $66 | v        $76 |
  333.  G      $47 | W     $57 | g    $67 | w        $77 |
  334.  H      $48 | X     $58 | h    $68 | x        $78 |
  335.  I      $49 | Y     $59 | I    $69 | y        $79 |
  336.  J      $4A | Z     $5A | j    $6A | z        $7A |
  337.  K      $4B | [     $5B | k    $6B | {        $7B |
  338.  L      $4C | \     $5C | l    $6C | |        $7C |
  339.  M      $4D | ]     $5D | m    $6D | }        $7D |
  340.  N      $4E | ^     $5E | n    $6E | ~        $7E |
  341.  O      $4F | _     $5F | o    $6F | DEL      $7F |
  342. ------------------------------------------------------------
  343.  
  344. ...............................................................................
  345. APPENDIX B    LIST OF MENU IDs
  346.  
  347. See "3.1 FORMAT OF THE KEYBOARD SETUP FILE" for specifying a menu ID.
  348. Menu IDs may be changed in future.
  349.  
  350. 1) VT window
  351.  
  352. Menu command            ID
  353. -------------------------------------
  354. [File] New connection        50110
  355. [File] Log            50120
  356. [File] Send file        50130
  357. [File] Transfer/Kermit/Receive    50141
  358. [File] Transfer/Kermit/Get    50142
  359. [File] Transfer/Kermit/Send    50143
  360. [File] Transfer/Kermit/Finish    50144
  361. [File] Transfer/XMODEM/Receive    50145
  362. [File] Transfer/XMODEM/Send    50146
  363. [File] Transfer/ZMODEM/Receive    50151
  364. [File] Transfer/ZMODEM/Send    50152
  365. [File] Transfer/B-Plus/Receive    50153
  366. [File] Transfer/B-Plus/Send    50154
  367. [File] Transfer/Quick-VAN/Receive 50155
  368. [File] Transfer/Quick-VAN/Send    50156
  369. [File] Change dir        50170
  370. [File] Print            50180
  371. [File] Disconnect        50190
  372. [File] Exit            50199
  373. [Edit] Copy            50210
  374. [Edit] Copy table        50220
  375. [Edit] Paste            50230
  376. [Edit] PasteCR            50240
  377. [Edit] Clear screen        50250
  378. [Edit] Clear buffer        50260
  379. [Setup] Terminal        50310
  380. [Setup] Window            50320
  381. [Setup] Font            50330
  382. [Setup] Keyboard        50340
  383. [Setup] Serial port        50350
  384. [Setup] TCPIP            50360
  385. [Setup] General         50370
  386. [Setup] Save setup        50380
  387. [Setup] Restore setup        50390
  388. [Setup] Load key map        50395
  389. [Control] Reset terminal    50410
  390. [Control] Are you there     50420
  391. [Control] Send break        50430
  392. [Control] Reset port        50440
  393. [Control] Open TEK        50450
  394. [Control] Close TEK        50460
  395. [Control] Macro         50470
  396. [Window] Window         50810
  397. [Help] Index            50910
  398. [Help] Using            50920
  399. [Help] About            50990
  400.  
  401. 2) TEK window
  402.  
  403. Menu command            ID
  404. -------------------------------------
  405. [File] Print            51110
  406. [File] Exit            51190
  407. [Edit] Copy            51210
  408. [Edit] Copy screen        51220
  409. [Edit] Paste            51230
  410. [Edit] PasteCR            51240
  411. [Edit] Clear Screen        51250
  412. [Setup] Window            51310
  413. [Setup] Font            51320
  414. [VTWin]             51410
  415. [Window] Window         50810
  416. [HELP] Index            51910
  417. [HELP] Using            51920
  418. [HELP] About            51990
  419.