home *** CD-ROM | disk | FTP | other *** search
/ Share Gallery 1 / share_gal_1.zip / share_gal_1 / LA / LA023.ZIP / ANSIKEY2.ZIP / ANSIKEY.DOC next >
Text File  |  1988-12-28  |  11KB  |  229 lines

  1.  
  2.  
  3.                      A     N     S     I     K     E     Y
  4.  
  5.                  How to reprogram your keyboard with  ANSI.SYS
  6.  
  7.                   copr. 1988,  Dave Williams, Jacksonville AR
  8.  
  9.                              version 2.0 12/28/88
  10.  
  11.  
  12.  PCDOS/MSDOS has had the ANSI.SYS driver ever since DOS 2.0. This program is a 
  13. device driver for the "console", or keyboard and screen of your computer. It 
  14. interprets a subset of the American National Standards Institute terminal 
  15. control codes. You can use ANSI.SYS in a variety of ways, but you mostly see 
  16. it used for color graphics on communications programs and used to do strange
  17. things with the system PROMPT command.
  18.  
  19.  The DOS manuals stopped covering ANSI.SYS with version 2.0. Beginning with 
  20. DOS 2.1, ANSI.SYS was relegated to the $150 DOS Technical Reference Manual. A 
  21. lot of people never found out about ANSI.SYS' interesting uses.
  22.  
  23.  One of the uses, quite thoroughly explained in the DOS 2.0 manual, was the 
  24. ability to reprogram the keyboard. You could conceivably turn the Enter key 
  25. into a number 2, but of somewhat better use was the ability to reprogram the 
  26. function keys to do things.
  27.  
  28.  There are a number of programs on the BBSs to help you reprogram the 
  29. keyboard. Some of them are intepreted BASIC, some are massive 75k .EXE files. 
  30. You don't need all this stuff, though. All you need to do is "TYPE" the
  31. appropriate file to the screen, and it will reprogram your keys easily!
  32.  
  33.  The ANSIKEY.PRG file included in this arc will reprogram your keys for you. 
  34. In your autoexec.bat file, include this line:
  35.  
  36.              type ansikey.prg
  37.  
  38.  The DOS ANSI.SYS program is rather limited. It will only accept about 200 
  39. bytes of key redefinition, and it will slow the system down somewhat. The 
  40. ZANSI.SYS file included with this archive has a much larger redefinition 
  41. buffer, and contains very fast direct-screen-writing code to actually speed 
  42. the screen up. You will be impressed with the improvement in screen update and 
  43. scrolling - unless you have a CGA card. ZANSI causes massive "snow" on a CGA, 
  44. so you'll have to use DOS' ANSI and stay inside the 200 byte limit. The doc 
  45. file and SYS driver for ZANSI have been extracted from a file called 
  46. ZANSI.ARC. They are in the public domain.
  47.  
  48.  Typing the file will set your keyboard. You can have several files, each 
  49. programming them in a different way. ANSIKEY.PRG includes definitions for F11 
  50. and F12 keys, these are ignored if you don't have a keyboard with them. It 
  51. will also wipe out the DOS F1-F6 "editing" keys and replace them with its own 
  52. definitions. You can delete the first six "normal" function key entries to 
  53. preserve the DOS editing keys. The best solution is to reprogram them anyway, 
  54. and use Chris Dunford's killer CED 1.0D or PC Magazine's DOSEDIT.
  55.  
  56.  Place the keystrokes you with to enter within the quote marks. For example, 
  57. to make the F1 key automatically bring up your terminal program, you can do 
  58. the following:
  59.  
  60.       (escape character)[0;59"qmodem",13p
  61.  
  62. and that will set the keyboard up so that all you have to do is tap the F1 key 
  63. to bring up your term program.
  64.  
  65.  The ',13p' at the end of each line is an ASCII carriage return, the same as 
  66. hitting the "enter" key after typing the keystrokes enclosed in the quote 
  67. marks. If you don't want the carriage return, just delete the 13, leaving the 
  68. 'p'.
  69.  
  70.  The required escape character (the left pointing arrow) is included in  the 
  71. ANSIKEY.PRG file.
  72.  
  73.  You can reprogram more than just function keys. Here are some useful keyboard 
  74. scan codes:
  75.            
  76.         Normal          Shift          Control         Alt
  77.  
  78. ESC     1
  79. 1       2                                               0;120
  80. 2       3                                               0;121
  81. 3       4                                               0;122
  82. 4       5                                               0;123
  83. 5       6                                               0;124
  84. 6       7                                               0;125
  85. 7       8                                               0;126
  86. 8       9                                               0;127
  87. 9       10                                              0;128
  88. 0       11                                              0;129
  89. -       12                                              0;130
  90. =       13                                              0;131
  91. TAB     15
  92. backtab none                                             0;15
  93. RETURN  28
  94.  
  95.  
  96.          Normal      Shift     Control      Alt
  97.  
  98.  
  99. a   =     30                               0;30
  100. b   =     48                               0;48
  101. c   =     46                               0;46
  102. d   =     32                               0;32
  103. e   =     18                               0;18
  104. f   =     33                               0;33
  105. g   =     34                               0;34
  106. h   =     35                               0;35
  107. i   =     23                               0;23
  108. j   =     36                               0;36
  109. k   =     37                               0;37
  110. l   =     38                               0;38
  111. m   =     50                               0;50
  112. n   =     49                               0;49
  113. o   =     24                               0;24
  114. p   =     25                               0;25
  115. q   =     16                               0;16
  116. r   =     19                               0;19
  117. s   =     31                               0;31
  118. t   =     20                               0;20
  119. u   =     22                               0;22
  120. v   =     47                               0;47
  121. w   =     17                               0;17
  122. x   =     45                               0;45
  123. y   =     21                               0;21
  124. z   =     44                               0;44
  125.  
  126.          Normal      Shift     Control      Alt
  127.  
  128. F1  =     0;59       0;84       0;94       0;104
  129. F2  =     0;60       0;85       0;95       0;105
  130. F3  =     0;61       0;86       0;96       0;106
  131. F4  =     0;62       0;87       0;97       0;107
  132. F5  =     0;63       0;88       0;98       0;108
  133. F6  =     0;64       0;89       0;99       0;109
  134. F7  =     0;65       0;90       0;100      0;110
  135. F8  =     0;66       0;91       0;101      0;111
  136. F9  =     0;67       0;92       0;102      0;112
  137. F10 =     0;68       0;93       0;103      0;113
  138. F11 =     0;152      0;162      0;172      0;182
  139. F12 =     0;153      0;163      0;173      0;183
  140.  
  141. ┌──┬──┬┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┬─────┬─────┐
  142. │59│60││ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │10 │11 │12 │13 │ 14  │ 69  │ 70  │
  143. ├──┼──┤├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼─────┼─────┼─────┤
  144. │F1│F2││Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ <── │ Num │Scrol│
  145. ├──┼──┼┼───┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─┬───┼──┬──┼──┬──┤
  146. │61│62││ 15 │16 │17 │18 │19 │20 │21 │22 │23 │24 │25 │26 │27  │28 │71│72│73│74│
  147. ├──┼──┤├────┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼────┼───┼──┼──┼──┼──┤
  148. │F3│F4││ Tab│ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ]  │ │ │7 │8 │9 │- │
  149. ├──┼──┼┼────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬───┤ │ ├──┼──┼──┼──┤
  150. │63│64││  29 │30 │31 │32 │33 │34 │35 │36 │37 │38 │39 │40 │41 │<┘ │75│76│77│78│
  151. ├──┼──┤├─────┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤   ├──┼──┼──┼──┤
  152. │F5│F6││  Ctr│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ ` │   │4 │5 │6 │+ │
  153. ├──┼──┼┼───┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┼──┼──┼──┤  │
  154. │65│66││42 │43 │44 │45 │46 │47 │48 │49 │50 │51 │52 │53 │54   │55 │79│80│81│  │
  155. ├──┼──┤├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼─────┼───┼──┼──┼──┤  │
  156. │F7│F8││Shf│ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │Shf  │ * │1 │2 │3 │  │
  157. ├──┼──┼┼───┴─┬─┴───┴───┴───┴───┴───┴───┴───┴───┴───┴──┬┴─────┼───┴──┼──┴──┼──┘
  158. │67│68││ 56  │                 57                     │  58  │  82  │ 83  │ 
  159. ├──┼──┤├─────┼────────────────────────────────────────┼──────┼──────┼─────┤ 
  160. │F9│F0││ Alt │             Space Bar                  │ Caps │  Ins │ Del │ 
  161. └──┴──┴┴─────┴────────────────────────────────────────┴──────┴──────┴─────┘ 
  162.  
  163.  
  164.  You will occaisonally run across a program that will read the keys directly 
  165. instead of doing it the "right" way through DOS. Fortunately, these programs 
  166. are fairly rare - in two years I've seen only two or three. 
  167.  If you need to occaisionally run such a program, you can use the ANSIKEY.NUL 
  168. file to eliminate the keyboard redefinitions. Simple TYPE ANSIKEY.NUL to
  169. zero-out the keyboard redefinitions, and you can reload them later. If you 
  170. encounter a program you commonly run that requires this you can use a CED 
  171. macro to zero the keys, run the program, and then reset it when you are 
  172. finished.
  173.  
  174.  My system has the following keys defined with this little utility:
  175.  
  176. normal keys
  177.  
  178. F1      nsd     (sorted directory)      F2      ED        (PC-write)
  179. F3      dir/p A:                        F4      dir/p B:
  180. F5      pctools (PC-Tools 4.22)         F6      diskcopy A: B:
  181. F7      exit                            F8      *.*       (with no CR)
  182. F9      cls                             F10     list function.84    (help)
  183.  
  184.  
  185. control keys
  186.  
  187. ^F1     masm    (Macro Assembler)       ^F2     msc      (Microsoft C)
  188. ^F3     aobj    (assemble to OBJ)       ^F4     cobj     (compile to OBJ)
  189. ^F5     tp      (Turbo Pascal)          ^F6     diskpark (park hard disk)
  190.  
  191.  
  192. alt keys
  193.  
  194. alt-D   qmodem  (Qmodem SST 3.1)
  195.  
  196.  
  197.  
  198.  I haven't found much use for any of the other ones, since I use CED macros 
  199. heavily.
  200.  
  201.  When you edit the ANSIKEY.PRG file, you will need to use a straight-ASCII 
  202. word processor, such as PC-Write or (gag) EDLIN. The (escape) character is 
  203. ASCII #27. You can enter this character in PC-Write and most other word 
  204. processors by holding down the alt key and typing "27" on the numeric 
  205. keypad. If you have one of the bloated commercial wordprocessors, you'll have 
  206. to figure out how to get it to write an ASCII file.
  207.  
  208.  ZANSI and ANSIKEY will correctly interpret the keyboard codes for a Tandy 
  209. 1000 TX 101-key (12 function key) keyboard. I haven't had a chance to try it 
  210. with a PS/2, so I don't know if it will work with the IBM keyboard. 
  211.  
  212.  Two additional text files are included with version 2.0 - FUNCTION.84 and 
  213. FUNCTION.101. They are help files to remind you of your function key 
  214. redefinitions. Set up one of the keys (I recommend F10 or F12) to a string 
  215. something like "LIST FUNCTION.84" to use Vern Buerg's LIST.COM to view your 
  216. key settings. The help screens are very useful when you are just beginning and 
  217. have trouble remembering what you've programmed the keys to do. If you use 
  218. more than one ANSIKEY.PRG file, you can call a separate help screen for each 
  219. loaded file.
  220.  
  221.  
  222.                                                         Enjoy!
  223.  
  224.                                                     Dave Williams
  225.  
  226. reachable at:
  227. 408-728-5598 (Night Modulator BBS)
  228. 404-454-8756 (Pecan Pi BBS)
  229.