Mod1 apparently used for "Meta" modifier
Submitted by Christian Marillat
Assigned to jacob berkman
Description
Hi,
On keyboards with a "Meta" key, I would expect that key to be used for raising the 8th bit or adding the ESC prefix to the key pressed. (In the sense of meta-x generating ESC x, and the like.) I haven't studied the source, but it seems that gnome-terminal simply uses the key that happens to emit the mod1 modifier.
On my setup I have both "Alt_L" and "Meta_L" keysyms, which emit mod1 and mod2 respectively. gnome-terminal should recognize that mod2 is in fact Meta and use that to generate the ESC prefix. Of course, if "Meta" is not present at all, it should should then default to Alt. This is compliant with ICCCM, and it's what XEmacs does when looking for a key to use as "Meta".
For reference, here is a description of the algorithm XEmacs uses, from the source code:
/* X bogusly doesn't define the interpretations of any bits besides ModControl, ModShift, and ModLock; so the Interclient Communication Conventions Manual says that we have to bend over backwards to figure out what the other modifier bits mean. According to ICCCM:
-
Any keycode which is assigned ModControl is a "control" key.
-
Any modifier bit which is assigned to a keycode which generates Meta_L or Meta_R is the modifier bit meaning "meta". Likewise for Super, Hyper, etc.
-
Any keypress event which contains ModControl in its state should be interpreted as a "control" character.
-
Any keypress event which contains a modifier bit in its state which is generated by a keycode whose corresponding keysym is Meta_L or Meta_R should be interpreted as a "meta" character. Likewise for Super, Hyper, etc.
-
It is illegal for a keysym to be associated with more than one modifier bit.
This means that the only thing that emacs can reasonably interpret as a "meta" key is a key whose keysym is Meta_L or Meta_R, and which generates one of the modifier bits Mod1-Mod5.
Unfortunately, many keyboards don't have Meta keys in their default configuration. So, if there are no Meta keys, but there are "Alt" keys, emacs will interpret Alt as Meta. If there are both Meta and Alt keys, then the Meta keys mean "Meta", and the Alt keys mean "Alt" (it used to mean "Symbol," but that just confused the hell out of way too many people).
This works with the default configurations of the 19 keyboard-types I've checked. [...] */
Version: 2.0.x
Resolution: RESOLVED WONTFIX