From: maf@DTEK.CHALMERS.SE (Martin Forssen)
Newsgroups: comp.windows.x.announce
Subject: New version of teh sunkbd patch available
Date: 21 Dec 92 21:48:14 GMT
Distribution: inet
Organization: Chalmers University of Technology, Gothenburg Sweden


 There is a new version of the sunkbd patch for X11R5 available
 on export.lcs.mit.edu (contrib/sunkbd.921216.tar.Z) (or by email from me).
 Below follows a copy of the CHANGES.kbd file, and for those who don't
 know what the sunkbd patch is a copy of the README.kbd file is
 attached below that. For those of you who has the first version
 installed there is a file (contrib/sunkbd0730-1216.tar.Z) which
 patches your release.

*** CHANGES.kbd

 * Fixed bug with key 'S' in the Netherland type 5 keyboard.

 * Added Igrave, ecircumflex and ediaeresis to make complete ISO8859-1.

 * Reordered the compose combinations into ISO8859-1 order.

 * Minor rewwite of the keymap constructing code:
    The keymap can't be to big anymore (to many compose combinations cased
    core dump)
    Removed the need for COMPACT_MAP (the holes are filled last).

 * Made the compose combinations work backwards to.

 * Added code to support autorepeat on/off for individual keys
   (thanks goes to mikeg@ingres.com (Mike Glendinning) for the inspiration)

 * Added code and command line options to choose between generating F36
   and F37 vs generating F11 and F12 for the function keys labelled 'F11'
   and 'F12'. The default is to generate F11 and F12.

 * Created a human readable table of the compose combinations.


*** README.kbd


 Keyboard patch version 921216

 This patch enables the Xsun (and XsunMono) server to work with
 other keyboards than type 4 US. It also fixes the Num_Lock and
 Compose keys. It was programmed by maf@dtek.chalmers.se. If you
 have any questions or comments about this piece of code feel free
 to send me an email.

  Installation

 This patch is distributed as a compressed tar file. When you unpack
 the archive you should get five files: README.kbd (this file),
 sunKeyMap.c, CHANGES.kbd, Compose.list and sunkbd.patch. Readme.kbd,
 CHANGES.kbd, Compose.list and sunKeyMap.c should be installed in
 mit/server/ddx/sun (move the old sunKeyMap.c to some safe backup place).
 You should the apply the patch (patch -p -s <sunkbd.patch) in the
 mit/server/ddx/sun directory.  The patch will touch the following files:
 ./README, ./sun.h, ./sunKbd.c, ./Xsun.man, ../../include/site.h
 and ../../../include/Sunkeysym.h. Now look in sunKeyMap.c and remove any
 unwanted keyboards (to save space) and then just rebuild the server.


  Known problems

 The only problem I know of today is that FrameMaker 3.1X doesn't
 recognize any compose combinations that ends with a shifted or
 alted character. This seems to be a bug in FM and the only workaround
 I have found is to define a macro file for these combinations (they
 are recognized as triggers).


  How it works

 When the server initializes it queries the keyboard for its type and
 layout. If it is anything else than type 4 (note that type 5 keyboards
 say they are type 4) it works as before. If it is a type4 keyboard
 the server finds the correct keycode to keysym mappings. These are
 contained in the file sunKeyMap.c. In this file you can find the
 layout tables for 35 different type 4 layouts. Each of these tables
 occupies about 2.5K in the server and since you probably won't need
 more than one or two different entries you can remove the others through 
 the comments at the top of the file (further instructions is in the
 file). Now the keycodes that are reported when you press any numerical
 key while NumLock is pressed or the final code of a compose combination
 is appended to the table.
 When the user presses a key the server first checks if NumLock is
 active. If it is the server searches a table of the numerical keyboards
 scancodes and if the current keycode is found in there it is transformed
 into another scancode which points to the correct entry in the keycode
 to keysym table. If the user has pressed the compose key the server
 first converts the scancode to a keysym, then it checks if this key is
 part of any legal compose combination if it is it is remembered else
 the compose key is deactivated. In either case the event is swallowed
 unless it was a modifier key. When the final key of the combination
 is pressed the server changes the scancode to one that points to the
 right location and passes the event on to the clients. Observe that
 this entry in the scancode to keycode table has the same value for
 all the combinations of modifier keys. This is since I can't know
 which modifiers are active when the last key is pressed.
 When the server checks for Num_Lock and Compose it actually decodes
 the scancodes it gets to keysyms and the check these. This enables the
 user to remap both Num_Lock and Compose (Multi_key).

	/MaF

--
Martin Forssen: maf@dtek.chalmers.se or maf@math.chalmers.se
System administrator at math and dtek at Chalmers univ. of technology