[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Frech keyboard with xfree



On Fri, 29 Oct 2004 08:15:37 +1000, "Benjamin Herrenschmidt" said:
> A common practice also on Macs is to reverse the meaning of Alt &
> Command (Meta) so that the key labelled "Alt" actually becomes Meta (and
> does the combo thing for  ~ or | still) and Command (Meta) becomes Alt.

A common trap that you're falling into here is referring to the key
"engravings" and key "symbols" interchangealby. This can especailly be a
problem with Alt, Meta, and Logo keys. If the Altkey is used to do "the
combo thing," then it is not the "Meta keysym" (which are Meta_L and
Meta_R) but instead it is either the Mode_switch or ISO_Level3_Shift
keysym. The Command/Apple/Logo key could be anything, but it is normally
assigned to Super_L and Super_R by default.

Perhaps it would be good to have "Mac OS-style modifiers" option as well
as the "Mac OS-style level 3" option.

> > I think there are two problems here. One is that the traditional
> > xlib/xmodmap keymaps and the XKB maps use groups and levels a little bit
> > differently (if you are using xmodmap to change third- or fourth-level
> > symbols, you're probably confusing XKB).
> 
> Ok, I'm not sure what the terminology is ... what are groups & levels ?
> I haven't found a doc on xmodmap & xkb...

There are links to OK docs on
http://freedesktop.org/Software/XKeyboardConfig

It helps if you think of groups as "keymap groups" and levels as "shift
levels." The basic shift level is for capital letters. So for the I-key
on a US keyboard, you have the first level (with no modifier keys
pressed) that generates a lower-case 'i', and the second level which has
an upper-case 'I'. For a keymap group, you could easily define a total
keymap (like Dvorak) to use with a regular qwerty keyboard. In this
case, the key engraved 'I' would have 'c' and 'C' on the first two shift
levels.

The problem started when the original xmodmap method for key definitions
defined the third level symbols (like deaddiareis for a Mac OS I-key) to
use a second *group* instead of using the third *level* in the first
group. When XKB came about, it followed this pattern. The problem with
this is that it becomes very difficult to use two keymap groups unless
neither of them has third-level symbols. For the Dvorak/qwerty setup to
use the Mac OS third-level symbols would require 4 (!) groups:  one for
the US symbols, one for the US 3rd-level symbols, another for the Dvorak
symbols and a fourth for the Dvorak Mac OS symbols. This is especially a
problem for Russian programmers who have a non-US keyboard:  mixing a
French and Russian keyboard is nearly impossible. So in XFree86 4.3, XKB
started using only one group per keyboard definition, which meant using
ISO_Level3_Shift instead of Mode_switch. (There's an alias
ISO_Group_Shift for Mode_switch which is probably a better name.)

Unfotunately, the symbols/macintosh/ files were not updated, which adds
even more pain for us.

> >  The other is the historical
> > difference between the Alt_L/Alt_R and Meta_L/Meta_R symbols. Some
> > people expect the PC's Altkeys to generate Alt_L/_R and others expect
> > Meta_L/_R.
> 
> Right, but that could just be an option to have them either way, but in
> both way, the same key (the one labelled Alt) should be used for those
> combos...

No. If both Altkeys should be used for generating third-level symbols,
then both Altkeys should be assigned to ISO_Level3_Shift (or
Mode_switch, for the old keymaps). Then perhaps for those using emacs
and Alt-tab in metacity, the Command/Apple/Logo keys could generate
Alt_L/_R.

> > And add to this that Mac OS users expect the Altkeys to behave like
> > Mode_switch or ISO_Level3_Shift to get third symbols, and Windows users
> > expect things like Altkey+Tabkey to cycle through windows and it's a
> > total mess.
> 
> Hehe, well, isn't xkb supposed to be able to make coffee ? :)

Yeah, but the docs are incomplete and terse, so the coffee gets served
without a cup!

I think maybe a solution would be to have three XkbOptions:  one that
defines the regular keys, one that defines the modifier keys, and one
that calls them both. Hmm. I'll see what I can do.

Frank



Reply to: