KBJEK 2.02 97-09-20 Programmed by Joakim Ek Freeware - Free of any charge & Free of any warranty WHAT IS THIS? KBJEK is a keyboard-driver that is used when You need to switch between several diffrent keyboard-layouts. It support up to 9 layouts in addition to the standard US keyboard supported by BIOS. If JEKFONT is also loaded the keyboard-driver can change the characters produced to match the current codepage. It is a TSR that occupies about 4K of memory. WHATS NEW 2.02 (97-09-04) Corrected the D-key in the F9-map (before sent an A) 2.01 (97-04-05) Fix bug that makes the previous key get shifted when typing more than 1 key in the buffer. Added German layout to table 8, wich was undefined before. 2.00 (96-12-29 to 97-01-03) First released version. 1.0x (96-02-18 to 96-12-30) Versions using one TSR/COM-file for each keyboardmap. No cooperation with jekfont. STARTING KBJEK You simply type KBJEK at the DOS-prompt, or place it in AUTOEXEC.BAT. If the program already is loaded it will not be loaded again, instead it will exit with errorlevel 1. It does NOT have any Unload-function implemented. You may pass a parameter to the program. Either when it is loaded the first time, to select the startup-table, or at any later time to change the table of the already loaded KBJEK. An example: KBJEK 2 This will activate table 2 of KBJEK. You must use exactly one space before the number, and none after. The number may be 1-9 to select the corresponding table or 0 to select the default BIOS keyboard. CONTROLLING KBJEK You may switch the table used by typing KBJEK # on the command-line, which is explained above. You may also switch table by pressing a key-compination. By holding down CTRL and ALT (either left or right) and press F1 to F9 to select the table 1 to 9, or F10 to select BIOS. You may control KBJEK from another program using an INT 16 call. You should always set AX to 415F and then the following: BH=00 Install-check and info. This will return: AX=BEEF (Indicates that it's installed) BL=00 to 09 The current table selected, 0=BIOS. CX=0202 The program-version 2.02 ES:DX Pointer to the special-key-translation table. Used by JEKFONT to change the ASCII-values on cyrillic keys to the current codepage. ES may also be used if you want to locate the program. BH=02 Select table. Returns nothing. You should supply the table in BL. 0 means none (BIOS) and 1-9 selects that table. BH=01,03-0F is reserved for futher use. If BH is none of the above or AX is not 415F the call will be redirected to the prevoius INT 16 routine without any action. BUILTIN TABLES The following tables are defined in KBJEK: 1 US-ALT Standard US but with linedraw and graphics when pressing RightALT (AltGr) with QWEASDZXCRFVBNM 2 SWEDISH Standard (almost) Swedish with AltGr-linedraw. 3 PHON jek Swedish with bulgarian mapped to lower-case letters in correspondance with jek-phonetic. 4 BG CAPS Bulgarian keyboard with uppercase kyrillic, and shifted/CAPS:ed with uppercase latin. 5 BULG Standard bulgarian keyboard with AltGr linedraw. 6 PHON BDS Phonetic Bulgarian according to BDS, with AltGr. 7 RUS Standard Russian JTSOKEN with AltGr linedraw. 8 GERMAN Standard (almost) German with AltGr-linedraw. 9 BGS Bulgarian placement but latin letters according to jek-phonetic. With AltGr-linedraw (reverse-phonetic). All tables have linedraw on AltGr (Right ALT) + QWE ASD ZXC RF and shaded boxes on VBNM. Some other AltGr-keys may also be defined, like {[]} on 7890 and <> on ,. When used with JEKFONT that changes keys according to codepage the linedraw will make the lines in the current codepage. REDEFINING TABLES This can be done, even though its not that easy. One reason to redefine may be that you don't use JEKFONT, in that case you wont get any cyrillic letters at all. Even though you may edit the COM-file directly, the easyest is to edit the source-code and then "recompile" using: DEBUG < KBJEK.MOC Near the end of the source there are the definitions of the 9 tables. Be careful not to change the adresses or redefine keys like ESC or TAB. You may define all the normal keys on the alphabetic-part. Arrows, numeric part or grey-keys cannot be redefined. The 102nd key can not have an ALT-code. There are 4 small tables to define per keyboard-table. The first is the values produced in normal case, the 2nd is the shifted values, the 3rd is a special control-table and the 4th is the AltGr values. The controltable has one byte per key where each bit has a special meaning. Bit 6 = 40 is the CAPS-bit. If set the key will select the upper table when CAPS-LOCK is lit. Bit 0=01= normal, bit 1=02=Shift and bit 2=04=AltGr is used to specify if the value in the tables is considered to be normal ASCII values (bit=0) or special characters (bit=1). Special characters are defined in JEKFONT and is used for the cyrillic and some other characters. If JEKFONT is'nt used you wont get anything when pressing the cyrillic characters. If you do not intend to use JEKFONT the keyboard-tables has to be redefined using the ASCII values of the codepage You intend to use. It is not recommended to use KBJEK without JEKFONT to use cyrillic characters since they are made to co-operate. By setting a value on a key to 0 it will remain it's standard BIOS character. If you want to disable a key enter the value 1 and set the corresponding special-character-bit to 1. Note that when a key is mapped to a special-character that is not available in the current codepage selected by JEKFONT the key will not output anything, or sometimes output 'rubbish'. You can't define a dead- or compose- key. COMPATIBILITY The program works by looking in the keyboardbuffer after each keypress, by hooking IRQ 1, and translating keys according to the current table. If no table is selected (Ctrl+Alt+F10) it wont change anything, it will just look for a Ctrl+Alt+Fn-key. If a key is mapped to a ASCII-value of 128 or above the scancode will be reset to 0 to avoid problems with some programs. Note though that many programs still don't allow ASCII 224 to be entered, thats not due to this driver, they won't accept the value typed with ALT on the num-pad, without a driver, either. (All builtin input functions in Q(uick)Basic & Maximus BBS mail is two programs i know have this restriction) It should work with all programs that read the keystrokes from the keyboard-buffer. And programs reading scancodes directly probably does'nt care about cyrillic anyway. In addition to the IRQ 1 (INT 9) routine it also hookes up on INT 16 (BIOS keyboard services) to enable communicating with the program when loaded in memory. if INT 16 is called with AX=415F & BH=0x it will take some action, any other value in AX or BH will make it jump to the previous INT 16 routine. If this should conflict with some other program it can be changed to another value by editing the source but i don't think thats neccesary. (You then have to edit JEKFONT too) AT LAST I hope You have use for this program. I know that i have ! If you want to ask anything, make suggestions or bug-reports or anything else you may email me at: jek@swipnet.se (At home, will probably expire Nov 1997) jocke@ecedata.se (To my work, hopfully will last forever) I wont promise that i fix anything, or even answer the letter, but i will try if i have the time. If a new version is made it can probably be downloaded at: http://www.ecedata.se/jocke/files/kbjek.arj Regards jek [EOF]