texmacs-dev
[Top][All Lists]
Advanced

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

[Texmacs-dev] Re: [TeXmacs] Re: Modifier mapping suddenly broken?


From: Lionel Elie Mamane
Subject: [Texmacs-dev] Re: [TeXmacs] Re: Modifier mapping suddenly broken?
Date: Wed, 1 Dec 2004 22:25:47 +0100
User-agent: Mutt/1.5.6+20040907i

On Wed, Dec 01, 2004 at 08:39:32PM +0100, Norbert Nemec wrote:
> Am Mittwoch, 1. Dezember 2004 15:37 schrieb Lionel Elie Mamane:
>> On Wed, Dec 01, 2004 at 03:27:44PM +0100, Norbert Nemec wrote:

>>> What I have discovered so far, is that my xmodmap is different from
>>> Lionel's:

>>>  mod1 Alt_L (0x40), Alt_L (0x7d), Meta_L (0x9c) mod4 Super_L
>>>  (0x7f), Hyper_L (0x80)

>>> Testing via xev shows, that the Win-key (which used to act as M-
>>> in TeXmacs) is actually represented by "Super_L".

>> Then that key is Super_L and your xkb config should be changed to make
>> it Meta_L.

> Where is a definitive source about "which key should be mapped to
> what".

In the user's brain. Which means it depends on the user. I like to
keep it simple and have a key mapped to what is printed on it (when it
makes sense), but some people strongly disagree.

> Somehow, I don't really like the idea of having a non-default
> mapping,

If you want to have a Meta key (or a separate notion of Meta modifier
and of Alt modifier), you need a "non-default mapping", because the
default mapping for german keyboard does _not_ have an Alt-modifier
that is distinct from a Meta-modifier. They are "merged".

> because it will most certainly cause bugs in some other corner of
> the system in the worst moment possible.

>>> (All of this on a Debian system

>> Debian woody, Debian sarge, Debian sid? What version of xlibs?

> Mostly Debian sarge, xlibs 4.3.0.dfsg.1-8, rebooted every day
> (i.e. also between update and appearance of the problem.)

Thanks. That's the latest one and the one I use. Will make testing
simpler.

>>> without any personal changes to the configuration.)

>> Then, the Flag key is not meta, this is "normal". The (IMHO very
>> broken, but that's another discussion) default is that the Alt key
>> acts as Meta. You need to add the "altwin:left_meta_win" option to
>> your xkb config. Do you know how to do that?

> This is not about opinions, but about "who sets the standard".

OK, I take back the "IMHO broken" comment. It won't get us anywhere,
it was just a venting of frustration.

There are actually *two* things going on here.

As I reconstructed the story, partly from first hand experience,
partly from writing of people running X when I was running ProDOS on
my Apple IIe, partly from Occam's razor applied to the former:

 - The original machines X was running on had a key labelled
   "control", a key labelled "meta" (or a funny symbol to be read like
   this) and a key labelled "alt" and a key labelled "super" (or a
   funny symbol...) and a key labelled "hyper" (or a funny
   symbol...). Or maybe only some of them.

 - Unix and X comes to the IBM compatible / Intel PC market, with the
   "old" keyboards I still remember (eighty-something or "extended"
   101/102 keys). No meta. No super. No hyper. Meta is actually more
   important than alt (for one, it is the only modifier bit that has a
   significance in terminals and consoles (non-X, things, thus). I
   think. And as such, the only one passed through SSH, telnet, rsh
   and friends. And probably the one that was most used for critical
   functions in applications.). So, when writing the keymap for these
   machines, sacrifice the alt modifier and put the meta modifier (and
   the Meta_L / Meta_R keysym) on the key(s) marked "Alt".

 - Years pass. Many people learn Unix and X on these keyboards.

   New programs and Desktop Environments get written by these
   people. They have never seen a Meta that is not Alt. Some of them
   think "Meta is just Emac's and X's funny name for Alt". Some of
   them regard them as the same. Synonyms or some such. Programs get
   written that use Meta, but call it "Alt" in the UI "because that's
   what's written on the key".

 - Come the 104/105 keys keyboards for Intel PCs. The keymap for them
   puts Alt_X on Alt, and Meta on the new Waving Flag key. Because,
   really, putting Alt_L on the left key marked "Alt" makes sense, you
   know.


   Users howl. They were used to having Meta on the alt key. The
   "change" is confusing to them. To unconfuse them, the keymaps
   "pc104" and "pc105" get back to the "pc101" behaviour: Meta is on
   the key marked "Alt", again removing the distinction between Meta
   and Alt again. As for the Waving Flag key, it get the next modifier
   on the list: Super.

That was one story. Now, the other story.

The X developers introduce the concept of "fake key" into X's modifier
handling, and in the same move put keysyms belonging to _different_
"named modifier"s into the same "modifier bit" (what I previously
called numbered modifier). Which confuses emacs, sawfish, TeXmacs,
etc.

> If I see it correctly now, altwin:left_meta_win is not set by
> default.

Yes.

> Therefore we should expect the dummy user not to have it set either,

If we don't expect the TeXmacs user to sanitise his keyboard map, then
we cannot have Alt and Meta be two different things in TeXmacs (which,
at this point, would be quite a refactoring of the
keystrokes). Because the default keyboard map does not have a separate
notion of "Alt" and "Meta".

(The user can also use alt:swapmeta to have Meta on the keys marked
 alt and alt on the waving flag keys, if he prefers. Or the left-only
 variant.)

> and TeXmacs should work out of the box. Does that mean that my patch
> should be used after all? (As I understand it now, all it does is to
> check for the case that altwin:left_meta_win is not set and work
> around it.)

What it does is that if the modifier bit meta is assigned to is the
same as the one alt is assigned to (no separate notion of alt and
meta), then it takes the one that means super and pretends it means
meta. This "works" because TeXmacs doesn't have a notion of super
(I've always wondered why, by the way. Uses Hyper, but not
 Super. Super comes before Hyper in my mind: A keyboard that doesn't
 have super wouldn't have hyper...)

And it corresponds to what you want with the default mapping because
you want meta to be on the waving flag key, and the latter is super in
the default mapping. But IMHO that is just breaking TeXmacs to make
the combination suit your taste, instead of registering what you want
with xkb: If you want Meta to be on the waving flag key, then put it
there! That's exactly what altwin:left_meta_win does for the left flag
key!


A workaround to the current X bug of having several modifiers tacked
on the same bit I would prefer to the Joris / Norbert one would be:

 - Read the keysym-to-modifier-bit mappings.

 - For each modifier bit, resolve multiples by an internal priority
   list: if modN (for some N) is both any two (or more) of:

   Meta, Alt, Hyper

   then take it to mean the first of these that it is, in this order.

(But I'll need to think about it again another day. It is too late in
 the night to be thinking straight anymore. And read the TeXmacs key
 handling code a bit more. Oh, $DEITY, I sure hope my laptop will be
 back from repair soon.)

-- 
Lionel




reply via email to

[Prev in Thread] Current Thread [Next in Thread]