home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / UTILITY / KEYBOARD / AK100A.ZIP / ANSIKEY.DOC next >
Encoding:
Text File  |  1991-04-11  |  14.1 KB  |  314 lines

  1.  
  2.  
  3.                            ANSIKEY, version 1.0a
  4.  
  5.  
  6.                                April 11, 1991
  7.  
  8.  
  9.                  Keyboard function keys redefinition through
  10.                      ANSI.SYS, made a whole lot easier!
  11.  
  12.  
  13.  
  14.  
  15.                        (c) Copyright 1991 by Ping Huang,
  16.                               All Rights Reserved
  17.  
  18.  
  19.  
  20.         PLEASE READ THIS!
  21.         -----------------
  22.  
  23.         I assume absolutely no legal or moral responsibility for any
  24.         damages which may result in any way from the use of this
  25.         program, nor do I make any guarantees as to its suitability for
  26.         your particular needs. Your choice to make use of this program
  27.         constitutes agreement with these terms. However, if you do
  28.         encounter problems, please drop me a line. I welcome any
  29.         comments, compliments, suggestions, *JOB*OFFERS*, etc. If you
  30.         like the program, and/or if it proves useful to you, read about
  31.         the Shareware concept.
  32.  
  33.         You are hereby granted permission to make use of this software
  34.         ONLY AS LONG AS IT TAKES TO EVALUATE ITS SUITABILITY FOR YOUR
  35.         PURPOSES. Use after the trial period is an infringement on my
  36.         rights unless you have registered with me. Feel free to upload
  37.         to any BBS's you frequent (and even those you don't) or
  38.         distribute to other users in other ways, on the conditions that:
  39.         (1) you make no modifications to the software or docs without
  40.         express written permission; (2) all files related to this
  41.         program that you received, you are passing along, preferably in
  42.         the form ANSIKEY.ZIP; (3) it is not bundled with a commercial
  43.         package (unless prior arrangements have been made); (4) if disk
  44.         copying and handling charges are levied in the distribution of
  45.         this program, they MUST be $5 or less. [Flame: I'm sick tired of
  46.         dealers who charge $7-8 for disks that are nearly empty!]
  47.  
  48.         If you have suggestions, problems, compliments, CONTRIBUTIONS
  49.         (hint,hint), et cetera, contact me:
  50.  
  51.     Addresses to reach me at:
  52.  
  53.         Ping Huang            e-mail: pshuang@athena.mit.edu
  54.         1435 - 26th Avenue        school: 450 Memorial Drive
  55.         San Francisco, CA 94122            Cambridge, MA 02139
  56.  
  57. ===================
  58. PROGRAM DESCRIPTION
  59. ===================
  60.  
  61. ANSIKEY makes it easy to make use of ANSI.SYS which came with your
  62. computer's DOS to redefine certain keys on your keyboard. These
  63. redefinitions (also known as macros) will work at the DOS command prompt
  64. and any program (such as DEBUG and many other command-line based
  65. programs) that uses DOS function calls and not ROM BIOS interrupts for
  66. keyboard input. If that sounded like gobbly-gook to you... if the
  67. program you have in mind has a fancy, full-screen display, then ANSIKEY
  68. probably won't help you, but it won't hurt to try.
  69.  
  70. You probably can think up your own uses for such a capability, but I'll
  71. tell you what kind of things I use it for (and I use it a lot, since I 
  72. wrote the program originally for own use and decided to refine it a bit 
  73. for general consumption).  When I program using Turbo Pascal, and the 
  74. program is too large for me to run it in the IDE shell, I use ANSIKEY to 
  75. define F9 to compile the program with all the compiler switches that 
  76. would be tedious to type over and over again. I program Alt-E to always 
  77. mean EXIT so that after I shell out of a program to execute some DOS 
  78. commands, with a single keystroke I can go back to the application very 
  79. quickly.  I program the other function keys to run programs that are 
  80. hidden deep in the directory structure of my hard disk, like 
  81. C:\FOO\BAR\LAMBDA\TURBO; by doing so I make it easy for me to run them,
  82. but I don't have to include such lengthy directory names in my DOS PATH.
  83.  
  84. =============
  85. PROGRAM USAGE
  86. =============
  87.  
  88.     ANSIKEY [DEF│UND│CLR│ESC│TST] [key scancode] [redefinition text]
  89.  
  90. By default, a brief condensed help screen appears on the screen.
  91.  
  92. THE FIRST PARAMETER
  93. -------------------
  94.  
  95.  ■ DEF defines the key using the following string on the command line.
  96.  ■ UND restores normal use of the key associated with the keycode.
  97.  ■ CLR undos all redef's made using ANSI.SYS and takes no params.
  98.    This may or may not work properly with ANSI.SYS substitutes, notably
  99.    DBLANSI.SYS that comes with the software package DoubleDOS.
  100.  ■ ESC outputs an ANSI command header(ESC+"["), followed by the rest of
  101.    the command line. Use only if you understand ANSI escape sequences.
  102.    You can use this to output ANSI codes that change the colors on your
  103.    screen, for example.
  104.  ■ TST will output the scan code for the next key pressed.
  105.  
  106. After the computer executes your command, the redefinition text will
  107. then be produced by the keystroke represented by the key scancode
  108. entered on the command line; this text may include any IBM-ASCII
  109. character with the exception of those that are translated; see the
  110. translation section of this documentation for more details.
  111.  
  112. ==========================
  113. What is ANSI.SYS, you ask?
  114. ==========================
  115.  
  116. Good question. ANSI.SYS is a device driver, or a special type of
  117. program, that comes with PC/MS-DOS. ANSI stands for American National
  118. Standards Institute; a committee at ANSI created a set of standardized
  119. codes for application programs to control how the screen looks by 
  120. outputting escape sequences, i.e. a stream of characters that are 
  121. preceded by the ESC character. Among the many functions that ANSI.SYS 
  122. provides is a way for keys to be redefined.
  123.  
  124. DOS does not automatically activate ANSI.SYS and load it into memory;
  125. you must explicitly tell DOS to load the device driver into memory from
  126. the ANSI.SYS file. To do this, look in the root directory of the disk
  127. that you regularly boot up your computer from. If there is already a
  128. file there called CONFIG.SYS, you need a text editor to insert this line
  129. (use the appropriate drive letter and directory to the file ANSI.SYS):
  130.  
  131.     DEVICE=[d:][\path\]ANSI.SYS
  132.  
  133. If CONFIG.SYS did not already exist, you should create one. The easy
  134. quickest way to do so is log onto the boot drive and change to the root
  135. directory. Then enter the following commands at the DOS command prompt:
  136.  
  137.     COPY CON \CONFIG.SYS           <ENTER>
  138.     DEVICE=[d:][\path\]ANSI.SYS    <ENTER>
  139.     BUFFERS=30                     <ENTER>
  140.     FILES=30                       <ENTER>
  141.  
  142. Now type Ctrl-Z and a final <ENTER>; you should see the disk light come
  143. on as the computer writes the info you typed into the CONFIG.SYS file.
  144.  
  145. NOTE: The last two lines are not necessary for ANSIKEY to work properly,
  146. but will help to speed up your computer's disk operations.
  147.  
  148.  
  149. =========================
  150. OTHER FEATURES OF ANSIKEY
  151. =========================
  152.  
  153. MNEMONIC ABBREVIATIONS
  154. ----------------------
  155.  
  156. The scan code numbers that represents keys are not easy to remember, and
  157. you shouldn't have to look them up tediously in a table -- that's what
  158. computers are for, after all. Thus, the TST parameter, which will return
  159. the scancode for the next keystroke that you make. However, to make
  160. things even easier, ANSIKEY knows a number of mnemonics for certain keys
  161. for your convenience. Mnemonics must be entered exactly as they appear
  162. below (although upper/lower case doesn't matter):
  163.  
  164.          F1   through  F12             CF1  through  CF12
  165.          SF1  through  SF10            AF1  through  AF10
  166.          A-A  through  A-Z             A1   through  A0
  167.  
  168. The easy way to remember these mnemonics (ironic, isn't it, my telling
  169. you how to remember the mnemonics) is to keep these rules in mind:
  170.  
  171.     F1...F12 represents the function keys, while A...Z and 1...0
  172.     represent the respective keys on the keyboard.
  173.  
  174.     Prefixing a 'A' character, a 'C' character, or a 'S' character means
  175.     that you are referring to the Alt'ed, Ctrl'ed, or Shifted function
  176.     keys. (That is, hold the Alt or Ctrl or Shift key down while
  177.     pressing one of the function keys.)
  178.  
  179.  
  180. CHARACTER SUBSTITUTION
  181. ----------------------
  182.  
  183. ANSIKEY by default will replace certain special characters (namely the 
  184. tilde, the greater-than and lesser-than signs, the vertical bar, the 
  185. space, and the carriage return) in the redefinition string with other 
  186. characters that would otherwise be intercepted by DOS and cannot be 
  187. entered as themselves.
  188.  
  189. The translation table is as follows:
  190.  
  191.         { becomes <         } becomes >          $ becomes |
  192.         ~ becomes CR        # becomes SPC
  193.  
  194. If you need to use one of the above characters ({,},$,~,#) "as is", use 
  195. a double quote as the first character of the redefinition. The quote 
  196. will be removed, and the characters above will not be substituted for.
  197.  
  198. I put the translation table in because with it you have the ability to
  199. execute multiple lines of DOS commands at the touch of just a single key
  200. without having to deal with the memory costs and interrupt conflict
  201. hassles caused by many TSR (memory resident) keyboard macro programs.
  202.  
  203. This opens up possiblities for a DOS menu system based on ANSIKEY. For
  204. example, you could program F1 to become "CLS~TYPE C:\MENU.TXT" where
  205. C:\MENU.TXT was a text file describing programs that can be started with
  206. a single keystroke. You would then put statements in the AUTOEXEC.BAT
  207. file to redefine those keys.
  208.  
  209. Contents of an example C:\MENU.TXT:
  210.  
  211.   ---------------------  begin cut  ---------------------
  212.      [Alt-2]   Lotus 1-2-3, release 2
  213.      [Alt-3]   Lotus 1-2-3, release 3
  214.      [Alt-W]   Wordperfect 5.1
  215.      [Alt-D]   dBASE III+
  216.  
  217.      [F1]      See this menu again
  218.  
  219.      Press the appropriate function key:
  220.   ---------------------   end cut   ---------------------
  221.  
  222. Partial contents of an example AUTOEXEC.BAT:
  223.  
  224.   ---------------------  begin cut  ---------------------
  225.      ANSIKEY DEF F1  CLS~TYPE C:\MENU.TXT
  226.      ANSIKEY DEF A-1 C:~CD \123R2~123~
  227.      ANSIKEY DEF A-2 C:~CD \123R3~123~
  228.      ANSIKEY DEF A-W C:~CD \WP51~WP~
  229.      ANSIKEY DEF A-D C:~CD \DBASE~DBASE~
  230.   ---------------------   end cut   ---------------------
  231.  
  232. This could make using programs much easier for novice users once a more
  233. experienced user set up such a system for them, since they wouldn't have
  234. to be tought DOS commands. This kind of DOS menu has some advantages
  235. over a specialized DOS menuing system: it takes up less of system memory
  236. than most DOS shell/menu programs, and it doesn't get in the way of
  237. expert users (who can simply completely ignore it), as specialized menu
  238. programs often do. Disadvantages include less control over what the
  239. ignorant user may or may not do.
  240.  
  241.  
  242. ==========================
  243. SHAREWARE: WHAT IT'S ABOUT
  244. ==========================
  245.  
  246.  
  247.           ██████▓▓▓▓▒▒▒▒░░░░  S H A R E W A R E  ░░░░▒▒▒▒▓▓▓▓██████
  248.      A DEFINITION BORROWED FROM ASSOCIATION OF SHAREWARE PROFESSIONALS
  249.      -----------------------------------------------------------------
  250.  
  251.      Shareware distribution gives users a chance to try software before
  252.      buying it. If you try a Shareware program and continue using it,
  253.      you are expected to register. Individual programs differ on details
  254.      -- some request registration while others require it, some specify
  255.      a maximum trial period. With registration, you get anything from
  256.      the simple right to continue using the software to an updated
  257.      program with a printed manual.
  258.  
  259.      Copyright laws apply to both Shareware and commercial software, and
  260.      the copyright holder retains all rights, with a few specific
  261.      exceptions as stated below. Shareware authors are accomplished
  262.      programmers, just like commercial authors, and the programs are of
  263.      comparable quality. (In both cases, there are good programs and bad
  264.      ones!)  The main difference is in the method of distribution. The
  265.      author specifically grants the right to copy and distribute the
  266.      software, either to all and sundry or to a specific group. For
  267.      example, some authors require written permission before a
  268.      commercial disk vendor may copy their Shareware.
  269.  
  270.      SO, Shareware is a distribution method, not a type of software.
  271.      You should find software that suits your needs and pocketbook,
  272.      whether it's commercial or Shareware. The Shareware system makes
  273.      fitting your needs easier, because you can try before you buy. And
  274.      because the overhead is low, prices are low also. Shareware has
  275.      the ultimate money-back guarantee -- if you don't use the product,
  276.      you don't pay for it.
  277.  
  278. All right, here goes the pitch you've been waiting for. If you make 
  279. often use of this program, you are obligated to send a contribution of 
  280. some sort to me. If you do not, you have no right whatsoever to continue 
  281. using this program! I'm not going to make ridiculous threats about how 
  282. it'll affect your karma if you don't pay for what you get, because to 
  283. not do so is to be stealing from me! Hopefully, your conscience will 
  284. convince you faster than my words ever could. Perhaps if I can get some 
  285. contributions for my program, I can justify all the time I spent not 
  286. doing my real work and stuff like that ....
  287.  
  288. A sum of $10 to $15 dollars is suggested, but most amounts will be
  289. gratefully accepted. IF YOU WOULD PREFER, YOU CAN MAKE THE CHECK OUT TO
  290. A CHARITY INSTEAD, and include a stamped addressed envelope; I will pass
  291. it on, and you can consider your legal and moral obligation discharged.
  292. Another alternative payment is to mail me a couple of diskettes with
  293. other useful shareware and public domain programs, especially those that
  294. you have found to be hard to find.
  295.  
  296. Just consider how much a few hours of custom programming would cost you,
  297. then consider that I spent more than just a FEW hours on this. Shareware 
  298. puts everyone on a "honor" system: you CAN prove its detractors wrong 
  299. and keep it alive.  Register other shareware programs you use, too!
  300.  
  301. If there is enough response, I may be convinced into doing upgrades to 
  302. ANSIKEY.  One change which I have in mind is to implement a more elegant 
  303. way to insert special characters into the redefinition string, i.e. 
  304. using metacharacters flagged with "$" to represent un-enterable keys.
  305.  
  306.                                         Ping Huang
  307.                     April 11, 1991
  308.  
  309.  
  310. P.S. Happy computing!
  311.  
  312. [distibution:simtel20]
  313.  
  314.