mKEYB readme.txt

******* WHAT mKEYB is ********************

mKEYB is a minimum keyboard driver for xxDOS, requiring
only ~540-600 bytes of memory to support international keyboards

mKEYB is also an interesting demonstration of

	'The Art of writing small TSR's in High Level Language'

** provided drivers **********************

***languages that seem to be OK (verified by one national user)

	mkeybGR  - german
	mkeybGRC - german with COMBI's
	mkeybSP  - spanish (with COMBI's, codepage 850)
	mkeybNL  - dutch
	mkeybUK  - united kingdom

***languages  that are not verified, just more or less correct
***translated from the Xkeyb keyboard definition tables

	mkeybRU  - russian - to be used with codepage 866 (known to have bugs)
	mkeybNO  - norwegian
	mkeybLA  - latin america
	mkeybIT  - italy
	mkeybDK  - daenish
	mkeybPO  - portugese
	mkeybSU  - finnish
	mkeybSV  - swedish
	mkeybSF  - swiss french
	mkeybSG  - swiss german
	


******* Implementation notes ******************

    mKEYB is based on the idea, that the keyboard is already
    (mostly) handled by the system BIOS, and that most keys
    are already correctly handled by it.

    this includes:
    function keys, cursor keys, ctrl,alt,del,shift,
    CtrlAltDelete, SysKey, ALT+numberPad, and most characters.

    also, all INT16 functions are already done by the BIOS.

    so mKEYB relies mostly on the BIOS to do what must be done,
    and only exchanges a few keys, as required by the national
    keyboard layout.

	mKEYBxx loads itself as high as possible; there is no need
	to LOADHIGH mKEYBXX



******* changing an existing language ******************

    to change an existing language, you need Borland's
    Turbo C++ 1.01; newer versions should work as well.

    please modify BUILD.BAT to your compiler directory.


    all keyboard definitions are located in a "keydefXX.h"
    file, where XX is the language you want to modify.

    change the definition file (see below), then run BUILD.BAT

    this should generate a new

        mkeybXX.exe

    testing the new keyboard handler is easy:

    start mkeybXX with any argument, and mkeyb will go into
    a debug mode, where all keys you type are shown; press
    ESCape to end this mode.

******* KEYDEFxx.H table layout:

    Scancode,Flags, several keyboard codes

FLAGS:
    CAPS:   this key reacts to CAPSLOCK (should be set for all
            alpha characters+umlauts)

    NORMAL:   3 character definitions for LOWER,SHIFT,CTRL
    ALTGREY:  1 addtional character for ALTGREY+key
    REPLACE:  1 SCANCODE, indicates to simply replace one
                scancode by another one.
                used by german keyboards to swap Z<-->Y

some characters:
	1 character if REPLACE 
    3 characters if NORMAL (unshifted, shifted, ctrl), followed by
    1 character, if ALTGREY



COMBI tables:
    these are not needed by all languages, but some (like spanish catalan)
    require them. they mostly define '`^ + aeiou

    COMBI define characters, that are generated by two sequential
    keystrokes, like '+A, `+A, ~+A, for some swedish characters.

    if needed, COMBI must be defined in both the MAKEFILE and
    in the keydefXX.h file.

    COMBI keys work like - for example for ^+A

main table:
    scancode for '^', NORMAL, COMBI11, 'x', 'y'

combi1table[] =
    {
    scancode for 'A', lower case a+^, upper case A+^
    scancode for 'E', lower case e+^, upper case E+^
    ...
    scancode for ' ', character '^' itself,character '^' itself
    }
    the last line is also used as default, for the case, that the next
    key is not 'AEIOUN', so ^+X will generate both '^' and X

******* adding a new language ******************

adding a new language (say japanese = JP)

decide, if you need COMBI characters or not

open MAKEFILE, search LANGUAGE_RU 
duplicate this section, and replace all RU with JP

open KEYBD.C, search LANGUAGE_RU again, and duplicate again.


search an existing KEYDEFXX.H, that more or less closely
resembles your layout (say keydefGR.H),
and copy it to keydefJP.h

if there already exists (in xkeyb) a key definition, run

	C:\mkeyb> FC GR.key JP.key

add these changes to keydefJP.h



run BUILD.BAT, and you should have a mKEYBJP.EXE now,
ready to be tested (see above)

*************************************************

have fun with it

24 apr 2002

tom ehlert


