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