7. The Old_Keyboard group of Modules

All of the Old Keyboard handling code is in the "plugin/keyboard" subdirectory.

Latest addition is SLANG.

7.1. Remarks in plugin/keyboard/keymaps.c

The DEAD codes must refer to keys that don't exist on any language keyboard. I hope nobody has a smily face key :-) dead_key_table is a list of the dead keys supported. They must be placed on the correct key in the keymaps above. See key_map_es_latin1.

-----

dos850_dead_map consists of the triple, {deadkey, letter, result}. It should be correct for all the code page 850 users (Western Europe). If you uses a different code page, please create a map! Jon Tombs jon@gtex02.us.es

7.2. Functions in plugin/keyboard/serv_xlat.c

These are the functions defined in plugin/keyboard/serv_xlat.c.

7.2.1. putrawkey

This function sends a raw keycode byte, e.g. read directly from the hardware, to DOS. It is both queued for the port60h emulation and processed for the BIOS keyboard buffer, using the national translation tables etc.

For DOS applications using int16h we will therefore not have to load KEYB.EXE, others (e.g. games) need their own drivers anyway.

This function is used if we are at the console and config.rawkeyboard=on.

7.2.2. putkey

This does all the work of sending a key event to DOS. scan - the keycode, one of the KEY_ constants from new-kbd.h make - TRUE for key press, FALSE for release ascii - the key's ascii value, or 0 for none.

Applications using int16h will always see the ASCII code passed here independently of the scancode, so no character translation needs/should be done. As DOS expects characters in IBM Extended ASCII, the keyboard clients may have to do ISO->IBM character translation or similar!

An emulated hardware scancode is also sent to port60h.

Note that you have to send both MAKE (press) and BREAK (release) events. If no BREAK codes are available (e.g. terminal mode), send them immediately after the MAKE codes. Also, shift keys should be sent (with ascii = 0).

7.2.3. set_shiftstate

This simply sets the keyboard server's shift state.

USE WITH CAUTION: this changes the keyboard flags without generating the appropriate shift key make/break codes that normally come along with such changes. This function is mostly intended for start-up shiftstate synchronisation.

Note also that you can't simply write to the shiftstate variable instead of using this function.

7.3. Functions in plugin/keyboard/keyb_raw.c

These are the functions defined in plugin/keyboard/keyb_raw.c.

7.3.1. raw_keyboard_init

Initialize the keyboard for RAW mode.

7.4. Functions in plugin/keyboard/keyb_slang.c

These are the functions defined in plugin/keyboard/keyb_slang.c.

7.4.1. slang_keyb_init()

Code is called at start up to set up the terminal line for non-raw mode.