On Mon, Mar 17, 2003 at 07:03:13PM +0600, Ivan Pascal wrote:
> 
>   There is an XKB feature that is completely undocumented, unfortunatly.
> The XLookupString (and so X{mb|wc}LookupString too) procedure having Control
> modifier in a key event tries to make a 'controlized' code from the symbol
> got from the current layout.
>   If this attempt fails, the procedure changes an XKB group to the first one
> and repeats the 'controlization' attempt.
> (The "documentation" is a source code of XLookupString in xc/lib/X11/XKBBind.c).
> 
>   Since a control code can be produced from an ascii code, if a key in the
> current group has such keysym you get the controlized code (the first attempt
> got success).  Otherwise you get the control code from the first group, if
> it is a latin-based layout (the second attempt is successful) or just a code
> from the first group.
> 
>   This behavior can be switched on/off by setting 'Xlib XKB control bit'
> XkbLC_ControlFallback or using the environment variable _XKB_CONTROL_FALLBACK
> (values can be 'on/off' or '0/1').  By default it's switched on.
> 
>   It worked well while all keyboard maps had the 'us' map as a first layout
> or were latin-based maps themself.  But as you see this method doesn't work
> in some multi-layout combinations.
> 
>   I would offer to add another one variable like:
> _XKB_CONTROL_FALLBACK_TO=<group>
> 
>   BTW there are users who would like to have the similar option for Alt
> modifier, i.e. _XKB_ALT_FALLBACK.
> 
>   Any opinions?

  IMHO, it would be better to just try all groups in turn, starting
from the current one, and then continuing to the others in order of
appearance. So the resulting order would be something like this:

        current group           lookup order
        -------------           ------------
        1                       1 2 3 4
        2                       2 1 3 4
        3                       3 1 2 4
        4                       4 1 2 3

  If none of the groups has an ASCII keysym, it can just fall back to
a Ctrl code from the current group.

  This approach has the advantage that it exhibits compatible
behaviour with the previous one (it only extends it), and it would
probably solve most of the easy cases. Plus, it's better when the end
user isn't required to set some weird environment variables.

-- 
Vasilis Vasaitis
[EMAIL PROTECTED]
+306976604701


_______________________________________________
I18n mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/i18n

Reply via email to