
Warning ! No warranty or guarantee of any kind expressed or implied.

This is indeed very quick and dirty, but it works and is usefull at least
for me.

The accompanying binary "frenchkb.bin" is an example of how you may patch 
TRW2000's keyboard tables to conform to your national keyboard.

Backup first !

1 : To apply the provided patch : 

- Open your copy of TRW2000.SYS  in your favorite Hex editor;
- locate the original keyboard translation table ( in version
1.23, it is at offset 0x3490C . I would expect the table format 
to be similar, but offset different, for earlier/later versions )
- REPLACE (not insert!) the 352 bytes starting at said offset 
using the contents of "frenchkb.bin" )
- Save patched TRW2000.SYS, replacing the original one. 

2 : Notes on using the patched version (assume you have a french keyboard) :

- The emulation puts letters and - most - symbols in line with what is 
printed on the keys. Be aware that perfect emulation is not possible.
First off, TRW eliminates extended (over 80h)ASCII codes, so don't 
expect you can type accented letters ! 

- First row numerals : I found it more convenient to get the digits 0-9 
without shift, and thus the associated symbols are obtained with shift.
This is opposite to the usual convention for the French kb; if you prefer
to have it the other way around, just patch the patch! Don't forget, this
is just an example !

- The third (alternate) graphics found on some keys will be generated
using the "Control" key , not the right "AltGr" as usual!

- Hotkey : Using this example patch, and assuming you did not modify the
HK settings in the INIfile, the hotkeys both to enter and leave TRW will
be : Ctrl-N (unchanged) for Ring 3,
     Ctrl-comma for Ring-0. That is, the same -geographical- key as usual.

The hot keys for leaving TRW are stored (that is, scan code 
and ASCII controlcode) just - before - the provided patch location, 
at least in 1.23 ;  I suggest you do not modify these, nor the INI file, 
but you must ensure that the selected key has the correct "control" ASCII
code else hotkey won't work for leaving TRW. This is exemplified in the
example I provided. 
Also, note that hotleying TO TRW and leaving TRW are handled different.
That is, are you sure you -really- want to mess with the hotkey processing ;)

3 : Making your own tables :

The table is 58h doublewords, indexed by OEM scancode.
I limit myself to swapping/changing the translations for "regular" codes,
no desire to rewrite a full fledged kb handler !

For each scancode :
byte+0 : type ( we're interested in 1:letter/2:regular ASCII /6:1st row nums)
    +1 : unshifted ASCII (must be < 80h); or FFh = none
    +2 : shifted - same comment apply
    +3 : control'd - again.

Have phun with this stuph :) Don't forget to post your national keyboard 
patches ! And you may always mail me for precisions and/or corrections!

-- 
Czerno  mailto:czernobyl@mail.ru