KEYMAP installs a very small TSR to remap keys on the PC keyboard.
Once installed, KEYMAP can be used to change key assignments at any time,
or to reset all key assignments back to their default values.

Use: KEYMAP [key=key ...] [options]

opts:   /C      - display key codes sorted by scanCode
        /D      - Display current key assignments
        /N      - display key codes sorted by Name
        /R      - Reset all key assignments to default
        /T      - interactive keyboard scancode Test
        +V      - force Virtualbox keyboard intercept fix  *1
        -V      - inhibit Vrtualbox keyboard intercept fix *1

'key' can be a key name or (scancode) - see /C and /N

eg:     F12=INS         - F12 performs INS function
        (57)=(53)       - F11 performs DEL function


*1 KEYMAP was originally written for use under Sun VirtualBox on a
Macbook - the Macbook has no way to generate an Insert scancode from
it's keyboard, so I use KEYMAP to change F12 into an Insert key.

In doing so, I discovered a bug in VirtualBox BIOS. Keymap uses the BIOS
15/4F "keyboard intercept" service. This interrupt is called with a key
scancode in a register, and allows the handler to change the scancode
before returning. The service *should* accept the new scancode and process
the keypress with that scancode. The code in the VirtualBox BIOS has a
PUSHA/POPA sequence around the INT 15/4F call, and therefore completely
ignores the new scancode (it is immediately replaced with the old one
by POPA). I modified KEYMAP to detect the VirtualBox BIOS and install a
different handler which patches the scancode on the VirtualBox stack.

In the unlikely event that another BIOS looks like VirtualBox sufficiently
to trigger this special handler, you can use '-V' to force KEYMAP not to
install the VirtualBox fix (it would corrupt the stack on non-Vbox systems).

If VirtualBox should change their BIOS code without fixing the bug (I've
reported it to them), KEYMAP might not detect it - you can use '+V' to
force the special handler (this would likely cause problems if you do it
on non-virtualbox systems). This can also be used to suppress the
"Using VirtualBox workaround." message.


Dunfield Development Services (DDS) offers software and firmware
development services specializing in systems and embedded applications.
For more information, visit: http://www.dunfield.com
