From jmrueda@diatel.upm.es  Thu Jul  3 14:48:17 1997
Received: from ioda.diatel.upm.es (ioda.diatel.upm.es [138.100.49.6])
          by hub.freebsd.org (8.8.5/8.8.5) with SMTP id OAA26205
          for <FreeBSD-gnats-submit@freebsd.org>; Thu, 3 Jul 1997 14:48:15 -0700 (PDT)
Received: by ioda.diatel.upm.es (SMI-8.6/SMI-SVR4) Thu, 3 Jul 1997 23:48:19 +0200
Message-Id: <1590*/S=jmrueda/OU=diatel/O=upm/PRMD=iris/ADMD=400net/C=es/@MHS>
Date: Thu,  3 Jul 1997 23:48:14 UTC+0200
From: Javier Martin Rueda <jmrueda@diatel.upm.es>
To: FreeBSD-gnats-submit@freebsd.org
Subject: Support for dead keys

>Number:         4024
>Category:       i386
>Synopsis:       Patch to add dead key support to syscons console driver
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    sos
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jul  3 14:50:01 PDT 1997
>Closed-Date:    Wed Jan 7 05:52:44 PST 1998
>Last-Modified:  Wed Jan  7 05:55:44 PST 1998
>Originator:     Javier Martn Rueda
>Release:        FreeBSD 2.2.1-RELEASE i386
>Organization:
>Environment:

	

>Description:

Currently, FreeBSD lacks support for dead keys, i.e., keys that modify
the meaning of the next key. These keys are commonly used in European
keyboards to compose accented vowels, etc.

I have added support for up to 4 dead keys to the syscons console driver.
You can use one for the acute accent, other for the grave accent, other
for the circumflex accent, and other for the diresis (umlaut), for instance.
At the moment, this is experimental, but seems to work ok. I'm sending
this so that whoever can try it, make suggestions, etc.

This is a brief explanation of the changes (which are not radical, anyhow):

Now, each keyboard scancode has 16 possible translations. These
translations are stored in two tables (more about this later) with
identical data types, called key_map, and dead_key_map. Each table
has 8 translations for each scancode.

The first table has exactly the same behaviour than previously, except
that there are four new actions: dead1 - dead4. If the user presses a
key whose mapping results in dead1 - dead4, then the next key will be
translated from the second table. For each dead key there are two
possible translations: the lowercase accented vowel, and the uppercase
accented vowel. That means 8 translations, which are stored in this
second table. Note: the second table could have a different structure
than the first one, as a couple of fields are not used, but it was
simpler this way, those two fields still could be made to have some
meaning, and it's not that much memory wasted. However, this is a
possible enhancement or fine tuning of the driver, if you want.

To load or get the keyboard mappings, there are four ioctl's. Two of them
(GIO_KEYMAP, and PIO_KEYMAP) have exactly the same behaviour as before,
and work only on the key_map table. The other two are new (GIO_DKEYMAP,
and PIO_DKEYMAP), and they work only on the dead_key_map table.

The kbdcontrol program has been modified as well, so that it knows about
these extended translations. The ascii descriptions of the keyboard
mappings have one line per scancode, as before, but with 16 translations
instead of 8 (that's for options -l, and -d). However, the -L option
now outputs two tables instead of one, as you can imagine. This means
that the old definitions used or generated by kbdcontrol must be updated
with the 8 additional translations if they are to be used by the new
kbdcontrol program.

Finally, I have made a sample keyboard definition file for ISO 8859-1
Spanish keyboards, and have included that layout in the kbdtables.h file
which is compiled in the kernel.

Why did I choose to put the extended mappings in a new table, and define
two new ioctl's to manage that table? There are two main reasons:

1) Despite the new features, the syscons driver interface remains source
and binary compatible with previous versions. If you want to apply this
patches, you can still use your old binaries and sources (X11R6 servers,
for instance, or even the old kbdcontrol). To those "old" programs, the
keyboard driver appears to not have changed.

2) If I put everything in just one structure, and copy the entire structure
via a single ioctl, I exceed the maximum ioctl argument size (by default,
1 page, 4 KB, defined in ioccom.h). You can change that size to be 2 pages,
but I didn't think that was a good idea, and, besides, I think the first
reason is important enough.

	

>How-To-Repeat:

	

>Fix:
	
	A set of patches for FreeBSD 2.2.1-RELEASE, and a new-style keyboard
	definition file for Spanish keyboards can be found in:

	ftp://ftp.diatel.upm.es/incoming/jmrueda2/dead_syscons970702.tar.gz

	


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->sos 
Responsible-Changed-By: wosch 
Responsible-Changed-When: Wed Aug 27 15:01:53 PDT 1997 
Responsible-Changed-Why:  
sos is Mr. syscons. 
State-Changed-From-To: open->closed 
State-Changed-By: yokota 
State-Changed-When: Wed Jan 7 05:52:44 PST 1998 
State-Changed-Why:  
Accent (dead) key support is added to 3.0-CURRENT (syscons.c 1.243). 
The code is not exactly the same as the patch submitted by 
the PR originator, though. 
>Unformatted:
