home *** CD-ROM | disk | FTP | other *** search
-
-
- ANSIKEY, version 1.0a
-
-
- April 11, 1991
-
-
- Keyboard function keys redefinition through
- ANSI.SYS, made a whole lot easier!
-
-
-
-
- (c) Copyright 1991 by Ping Huang,
- All Rights Reserved
-
-
-
- PLEASE READ THIS!
- -----------------
-
- I assume absolutely no legal or moral responsibility for any
- damages which may result in any way from the use of this
- program, nor do I make any guarantees as to its suitability for
- your particular needs. Your choice to make use of this program
- constitutes agreement with these terms. However, if you do
- encounter problems, please drop me a line. I welcome any
- comments, compliments, suggestions, *JOB*OFFERS*, etc. If you
- like the program, and/or if it proves useful to you, read about
- the Shareware concept.
-
- You are hereby granted permission to make use of this software
- ONLY AS LONG AS IT TAKES TO EVALUATE ITS SUITABILITY FOR YOUR
- PURPOSES. Use after the trial period is an infringement on my
- rights unless you have registered with me. Feel free to upload
- to any BBS's you frequent (and even those you don't) or
- distribute to other users in other ways, on the conditions that:
- (1) you make no modifications to the software or docs without
- express written permission; (2) all files related to this
- program that you received, you are passing along, preferably in
- the form ANSIKEY.ZIP; (3) it is not bundled with a commercial
- package (unless prior arrangements have been made); (4) if disk
- copying and handling charges are levied in the distribution of
- this program, they MUST be $5 or less. [Flame: I'm sick tired of
- dealers who charge $7-8 for disks that are nearly empty!]
-
- If you have suggestions, problems, compliments, CONTRIBUTIONS
- (hint,hint), et cetera, contact me:
-
- Addresses to reach me at:
-
- Ping Huang e-mail: pshuang@athena.mit.edu
- 1435 - 26th Avenue school: 450 Memorial Drive
- San Francisco, CA 94122 Cambridge, MA 02139
-
- ===================
- PROGRAM DESCRIPTION
- ===================
-
- ANSIKEY makes it easy to make use of ANSI.SYS which came with your
- computer's DOS to redefine certain keys on your keyboard. These
- redefinitions (also known as macros) will work at the DOS command prompt
- and any program (such as DEBUG and many other command-line based
- programs) that uses DOS function calls and not ROM BIOS interrupts for
- keyboard input. If that sounded like gobbly-gook to you... if the
- program you have in mind has a fancy, full-screen display, then ANSIKEY
- probably won't help you, but it won't hurt to try.
-
- You probably can think up your own uses for such a capability, but I'll
- tell you what kind of things I use it for (and I use it a lot, since I
- wrote the program originally for own use and decided to refine it a bit
- for general consumption). When I program using Turbo Pascal, and the
- program is too large for me to run it in the IDE shell, I use ANSIKEY to
- define F9 to compile the program with all the compiler switches that
- would be tedious to type over and over again. I program Alt-E to always
- mean EXIT so that after I shell out of a program to execute some DOS
- commands, with a single keystroke I can go back to the application very
- quickly. I program the other function keys to run programs that are
- hidden deep in the directory structure of my hard disk, like
- C:\FOO\BAR\LAMBDA\TURBO; by doing so I make it easy for me to run them,
- but I don't have to include such lengthy directory names in my DOS PATH.
-
- =============
- PROGRAM USAGE
- =============
-
- ANSIKEY [DEF│UND│CLR│ESC│TST] [key scancode] [redefinition text]
-
- By default, a brief condensed help screen appears on the screen.
-
- THE FIRST PARAMETER
- -------------------
-
- ■ DEF defines the key using the following string on the command line.
- ■ UND restores normal use of the key associated with the keycode.
- ■ CLR undos all redef's made using ANSI.SYS and takes no params.
- This may or may not work properly with ANSI.SYS substitutes, notably
- DBLANSI.SYS that comes with the software package DoubleDOS.
- ■ ESC outputs an ANSI command header(ESC+"["), followed by the rest of
- the command line. Use only if you understand ANSI escape sequences.
- You can use this to output ANSI codes that change the colors on your
- screen, for example.
- ■ TST will output the scan code for the next key pressed.
-
- After the computer executes your command, the redefinition text will
- then be produced by the keystroke represented by the key scancode
- entered on the command line; this text may include any IBM-ASCII
- character with the exception of those that are translated; see the
- translation section of this documentation for more details.
-
- ==========================
- What is ANSI.SYS, you ask?
- ==========================
-
- Good question. ANSI.SYS is a device driver, or a special type of
- program, that comes with PC/MS-DOS. ANSI stands for American National
- Standards Institute; a committee at ANSI created a set of standardized
- codes for application programs to control how the screen looks by
- outputting escape sequences, i.e. a stream of characters that are
- preceded by the ESC character. Among the many functions that ANSI.SYS
- provides is a way for keys to be redefined.
-
- DOS does not automatically activate ANSI.SYS and load it into memory;
- you must explicitly tell DOS to load the device driver into memory from
- the ANSI.SYS file. To do this, look in the root directory of the disk
- that you regularly boot up your computer from. If there is already a
- file there called CONFIG.SYS, you need a text editor to insert this line
- (use the appropriate drive letter and directory to the file ANSI.SYS):
-
- DEVICE=[d:][\path\]ANSI.SYS
-
- If CONFIG.SYS did not already exist, you should create one. The easy
- quickest way to do so is log onto the boot drive and change to the root
- directory. Then enter the following commands at the DOS command prompt:
-
- COPY CON \CONFIG.SYS <ENTER>
- DEVICE=[d:][\path\]ANSI.SYS <ENTER>
- BUFFERS=30 <ENTER>
- FILES=30 <ENTER>
-
- Now type Ctrl-Z and a final <ENTER>; you should see the disk light come
- on as the computer writes the info you typed into the CONFIG.SYS file.
-
- NOTE: The last two lines are not necessary for ANSIKEY to work properly,
- but will help to speed up your computer's disk operations.
-
-
- =========================
- OTHER FEATURES OF ANSIKEY
- =========================
-
- MNEMONIC ABBREVIATIONS
- ----------------------
-
- The scan code numbers that represents keys are not easy to remember, and
- you shouldn't have to look them up tediously in a table -- that's what
- computers are for, after all. Thus, the TST parameter, which will return
- the scancode for the next keystroke that you make. However, to make
- things even easier, ANSIKEY knows a number of mnemonics for certain keys
- for your convenience. Mnemonics must be entered exactly as they appear
- below (although upper/lower case doesn't matter):
-
- F1 through F12 CF1 through CF12
- SF1 through SF10 AF1 through AF10
- A-A through A-Z A1 through A0
-
- The easy way to remember these mnemonics (ironic, isn't it, my telling
- you how to remember the mnemonics) is to keep these rules in mind:
-
- F1...F12 represents the function keys, while A...Z and 1...0
- represent the respective keys on the keyboard.
-
- Prefixing a 'A' character, a 'C' character, or a 'S' character means
- that you are referring to the Alt'ed, Ctrl'ed, or Shifted function
- keys. (That is, hold the Alt or Ctrl or Shift key down while
- pressing one of the function keys.)
-
-
- CHARACTER SUBSTITUTION
- ----------------------
-
- ANSIKEY by default will replace certain special characters (namely the
- tilde, the greater-than and lesser-than signs, the vertical bar, the
- space, and the carriage return) in the redefinition string with other
- characters that would otherwise be intercepted by DOS and cannot be
- entered as themselves.
-
- The translation table is as follows:
-
- { becomes < } becomes > $ becomes |
- ~ becomes CR # becomes SPC
-
- If you need to use one of the above characters ({,},$,~,#) "as is", use
- a double quote as the first character of the redefinition. The quote
- will be removed, and the characters above will not be substituted for.
-
- I put the translation table in because with it you have the ability to
- execute multiple lines of DOS commands at the touch of just a single key
- without having to deal with the memory costs and interrupt conflict
- hassles caused by many TSR (memory resident) keyboard macro programs.
-
- This opens up possiblities for a DOS menu system based on ANSIKEY. For
- example, you could program F1 to become "CLS~TYPE C:\MENU.TXT" where
- C:\MENU.TXT was a text file describing programs that can be started with
- a single keystroke. You would then put statements in the AUTOEXEC.BAT
- file to redefine those keys.
-
- Contents of an example C:\MENU.TXT:
-
- --------------------- begin cut ---------------------
- [Alt-2] Lotus 1-2-3, release 2
- [Alt-3] Lotus 1-2-3, release 3
- [Alt-W] Wordperfect 5.1
- [Alt-D] dBASE III+
-
- [F1] See this menu again
-
- Press the appropriate function key:
- --------------------- end cut ---------------------
-
- Partial contents of an example AUTOEXEC.BAT:
-
- --------------------- begin cut ---------------------
- ANSIKEY DEF F1 CLS~TYPE C:\MENU.TXT
- ANSIKEY DEF A-1 C:~CD \123R2~123~
- ANSIKEY DEF A-2 C:~CD \123R3~123~
- ANSIKEY DEF A-W C:~CD \WP51~WP~
- ANSIKEY DEF A-D C:~CD \DBASE~DBASE~
- --------------------- end cut ---------------------
-
- This could make using programs much easier for novice users once a more
- experienced user set up such a system for them, since they wouldn't have
- to be tought DOS commands. This kind of DOS menu has some advantages
- over a specialized DOS menuing system: it takes up less of system memory
- than most DOS shell/menu programs, and it doesn't get in the way of
- expert users (who can simply completely ignore it), as specialized menu
- programs often do. Disadvantages include less control over what the
- ignorant user may or may not do.
-
-
- ==========================
- SHAREWARE: WHAT IT'S ABOUT
- ==========================
-
-
- ██████▓▓▓▓▒▒▒▒░░░░ S H A R E W A R E ░░░░▒▒▒▒▓▓▓▓██████
- A DEFINITION BORROWED FROM ASSOCIATION OF SHAREWARE PROFESSIONALS
- -----------------------------------------------------------------
-
- Shareware distribution gives users a chance to try software before
- buying it. If you try a Shareware program and continue using it,
- you are expected to register. Individual programs differ on details
- -- some request registration while others require it, some specify
- a maximum trial period. With registration, you get anything from
- the simple right to continue using the software to an updated
- program with a printed manual.
-
- Copyright laws apply to both Shareware and commercial software, and
- the copyright holder retains all rights, with a few specific
- exceptions as stated below. Shareware authors are accomplished
- programmers, just like commercial authors, and the programs are of
- comparable quality. (In both cases, there are good programs and bad
- ones!) The main difference is in the method of distribution. The
- author specifically grants the right to copy and distribute the
- software, either to all and sundry or to a specific group. For
- example, some authors require written permission before a
- commercial disk vendor may copy their Shareware.
-
- SO, Shareware is a distribution method, not a type of software.
- You should find software that suits your needs and pocketbook,
- whether it's commercial or Shareware. The Shareware system makes
- fitting your needs easier, because you can try before you buy. And
- because the overhead is low, prices are low also. Shareware has
- the ultimate money-back guarantee -- if you don't use the product,
- you don't pay for it.
-
- All right, here goes the pitch you've been waiting for. If you make
- often use of this program, you are obligated to send a contribution of
- some sort to me. If you do not, you have no right whatsoever to continue
- using this program! I'm not going to make ridiculous threats about how
- it'll affect your karma if you don't pay for what you get, because to
- not do so is to be stealing from me! Hopefully, your conscience will
- convince you faster than my words ever could. Perhaps if I can get some
- contributions for my program, I can justify all the time I spent not
- doing my real work and stuff like that ....
-
- A sum of $10 to $15 dollars is suggested, but most amounts will be
- gratefully accepted. IF YOU WOULD PREFER, YOU CAN MAKE THE CHECK OUT TO
- A CHARITY INSTEAD, and include a stamped addressed envelope; I will pass
- it on, and you can consider your legal and moral obligation discharged.
- Another alternative payment is to mail me a couple of diskettes with
- other useful shareware and public domain programs, especially those that
- you have found to be hard to find.
-
- Just consider how much a few hours of custom programming would cost you,
- then consider that I spent more than just a FEW hours on this. Shareware
- puts everyone on a "honor" system: you CAN prove its detractors wrong
- and keep it alive. Register other shareware programs you use, too!
-
- If there is enough response, I may be convinced into doing upgrades to
- ANSIKEY. One change which I have in mind is to implement a more elegant
- way to insert special characters into the redefinition string, i.e.
- using metacharacters flagged with "$" to represent un-enterable keys.
-
- Ping Huang
- April 11, 1991
-
-
- P.S. Happy computing!
-
- [distibution:simtel20]
-
-