mKEYB readme.txt

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

mKEYB is a minimum keyboard driver for xxDOS, requiring
only ~500 bytes of memory to support international keyboards
	(russian 452, german 474, spanish 718 byte)

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)

	mkeyb BE  - belgium
	mkeyb GR  - german
	mkeyb GRC - german with COMBI's
	mkeyb SP  - spanish (with COMBI's) (codepage 850)
	mkeyb NL  - dutch
	mkeyb UK  - united kingdom
	mkeyb BR  - Brazil (portugese)
	mkeyb BX  - Brazil (portuges) extended
	mkeyb RU  - russian - to be used with codepage 866
	mkeyb PL  - polish
	mkeyb HE  - hebrew
	mkeyb FR  - french (by snoopy81)

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

	mkeyb NO  - norwegian
	mkeyb LA  - latin america
	mkeyb IT  - italy
	mkeyb DK  - daenish
	mkeyb PO  - portugese
	mkeyb SU  - finnish
	mkeyb SV  - swedish
	mkeyb SF  - swiss french
	mkeyb SG  - swiss german
	mkeyb SL  - slovenian



******* 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:

    All keyboard definitions should be created, using some 
    predefined MACROS. these are
	

    PUNCT(scan,lcase,ucase) 
    	upper and lower case character definition
    ALPHA(scan,lcase,ucase) 
    	like PUNCT, but obeys CAPSLOCK rules
    	
    PUNCT_CTRL(scan,lcase,ucase,ctrl) 
    ALPHA_CTRL(scan,lcase,ucase,ctrl) 
    	like above, but additionally a CtrlCharacter is defined
    	
    ALTGR(scan,code) 
    	this scancode generates addition char if ALTGREY is pressed
    ALTGRSHIFT(scan,code1,code2) 
    	like ALTGR, but shifted key generates different key

    PUNCT_ALTGR(scan,lcase,ucase,altgr)           
    PUNCT_CTRL_ALTGR(scan,lcase,ucase,ctrl,alt) 

    REPLACE(scan,code)
    	replaces one scancode by another one (german keyboards
    	have 'Y' and 'Z' swapped)


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 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 LANG_GR
duplicate this section, and replace all GR with JP

open KEYBD.C, search LANG_GR 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

5 jun 2002

tom ehlert