home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 December
/
simtel1292_SIMTEL_1292_Walnut_Creek.iso
/
msdos
/
keyboard
/
fix101ky.arc
/
FIX101KY.DOC
< prev
next >
Wrap
Text File
|
1988-07-24
|
4KB
|
87 lines
Copyright (c) 1988 Thomas G. Hanlin III
FIX101KY v1.0
"Enhanced" keyboard redefinition utility
The purpose of this tiny TSR is to make the 101-key "enhanced" keyboard
more like earlier IBM keyboards (or indeed, like any other keyboard). It
turns off the "num lock" state when executed, and thereafter redefines the
meaning of a number of keys.
DISTRIBUTION:
This utility may be distributed freely, PROVIDED that it is distributed
with all of its files, and with those files in unmodified condition. The
files that should be here are FIX101KY.ASM, FIX101KY.COM, FIX101KY.DOC, and
SNOOP.ASM. No fee may be charged for distribution, other than a shipping and
handling fee which may not exceed $6.00.
GENERAL NOTES:
FIX101KY.COM is a terminate-and-stay-resident (TSR) program. It
occupies less than 400 bytes of memory. No provision has been made to detect
previous loads of the program, since it is intended to be executed only once,
when you start up your computer. It is suggested that if you find the
program useful, you should put it in your AUTOEXEC.BAT file. See your DOS
manual if you have any questions about AUTOEXEC files.
When the TSR is first installed, it will turn off the "Num Lock" state,
so that you won't be obliged to use the new, badly-designed cursor pad. This
is done before the TSR is activated, and is not a permanent state.
After installation, FIX101KY remaps a number of keys to more expected
positions. This redefinition will be semi-permanent, in that it will last
until you reboot or turn off your computer. Some programs that access the
keyboard directly, bypassing usual methods, may not be affected by the
redefinition. The new keyboard will act as follows:
Used To Be Will Be
========== =======
~ ` ESC
ESC ~ `
CAPS LOCK CTRL
CTRL ALT
ALT CAPS LOCK
PROGRAMMING NOTES:
Source code, in assembly language, has been provided. This will enable
you to redefine the keyboard to suit your own tastes, assuming you are fairly
conversant with assembly language. Please do not distribute modified
versions of FIX101KY. Any changes you make should be for your own use only.
The FIX101KY utility hooks into INT 15h, which used to be for cassette
handling, and is now "miscellaneous system services". Among those services
is keyboard handling. We're modifying the keypress information before it
gets seen by other programs. Since it's raw information, we have to account
for each key in two states:
1) The key is first pressed. We get a scan code below 80h.
2) The key is released. We get a scan code ORed with 80h.
Since the keyboard handler is invoked fairly often, it's important to
keep the code as fast as reasonably possible. Since it's a TSR and takes up
valuable system memory, it's also important to keep the code as small as
reasonably possible, although speed largely takes precedence. FIX101KY was
designed with that in mind, so if the code doesn't appear as elegant as it
might be, please remember these constraints. Also note that no registers
are modified, to avoid the overhead of saving and restoring. With an
interrupt handler, you've got to leave things as you found them... and you
can't count on an existing stack, since anything could have been happening
when the interrupt took place.
The SNOOP.ASM file contains a quick-and-dirty utility which will let you
snoop on the scan codes that are returned by various keys. It writes the
information directly into video memory, in the upper left corner of the
screen. It assumes you're in text mode, and presents the scan code as a
displayed character. You can decode this using an extended-ASCII chart.
Don't forget to account for the 80h key release flag. Note also that you may
have to modify the video segment address for your monitor: B000h (MDA) is
assumed, whereas you may want to use B800h (CGA).