Problem with Super key
Stephen J. Turnbull
stephen at xemacs.org
Mon Mar 5 23:55:51 EST 2007
Josip Gracin writes:
> Interesting. The mapping that I have is the default in Ubuntu/Gnome,
> and XEmacs somehow manages to grok it without issuing any warnings.
No, XEmacs is not grokking it; the mapping is broken (definitely if
XKB is not available, and as far as I know XKB-enabled servers are
required to be backward compatible by the XKB spec) and XEmacs failed
to behave as you expected as a result. It is possible that either
XEmacs's keyboard handler has been patched or the warnings suppressed
by the distro. (Mandrake, at least, deliberately broke XEmacs's
behavior with respect to Alt/Meta in order to force compatibility with
their broken scheme.)
My guess is that the reason that this sort of works is that the
context where Alt and Meta are used is applications, and they usually
only have one of the two modifiers, and just look for their favorite
modifier. Since both are on the mod1 bit, the user sees correct
behavior. Similarly for Super and Hyper, which are mostly used to
keep window manager key bindings out of the way of the applications.
With the modern XKB extension, there may be other ways to handle
modifiers. However, porting XEmacs to XKB is a fairly large task,
compounded by the fact that the XKB developers provided no API
documentation worthy of the name the last time I looked. I guess I'll
have to take another look.
> Is XEmacs treating Alt as being the same as Meta?
Hard to say, without looking at exactly the configuration of XEmacs as
well as the patches applied.
What actually is supposed to happen is that XEmacs looks at the
keyboard mapping, and checks it for sanity. At this point the "your X
server keyboard configuration is broken" warnings are issued. Next,
XEmacs checks the modifer map for a modifier bit assigned to a Meta
key. If found, Meta (physical) is Meta (XEmacs). If not found,
XEmacs checks for a modifier bit assigned to an Alt key. If found,
Alt (physical) is Meta (XEmacs). If not found, there will be no Meta
modifier, and you must use the ESC key as a prefix key to generate
XEmacs Meta keystrokes.
The reason for this behavior is that most historic Unix workstations
had a Meta key. When PC-based X servers started to become popular,
vendors had only the Alt key, and they had a choice: to assign it the
Alt keysym or the Meta keysym. Most chose the former, reasonable as
only the apps need to deal with the issue. Documenting the Alt-is-
really-Meta choice would be hard, and many users would fail to notice
and simply report a bug. I certainly couldn't blame them.
More information about the XEmacs-Beta