On Wed, Mar 31, 2004 at 01:02:43PM +0200, Felix Kühling wrote:
[...]
> If this is a bug in Emacs then I wonder why the Meta-key works correctly
> with altwin:meta_win but fails with altwin:left_meta_win. How is the
> left Windows key handled differently between the two options? Should
> there be any difference? If not then I'd suspect that it's rather a
> problem in X.

Erwan David explained (in French) in this thread
  http://lists.debian.org/debian-user-french-0404/msg00412.html
and in #234081 that with altwin:left_meta_win, Mod4 is bound to Meta_L
and Super_R.  But (X)emacs seems not to be XKB-aware, and thus it cannot
determine whether Meta_L or Super_R is pressed when it received a Mod4
event, and Mod4 is disabled.

If (X)emacs used XKB extensions, it could make this distinction, so one
could argue that this is a limitation in (X)emacs.

But on the other hand, having 2 keys of distinct types (Meta and Super)
bound to the same modifier is certainly not a good idea; if these keys
handle different actions, binding them to different modifiers is
natural.  This is what Erwan does in #234081 to fix this problem.
I filed http://bugzilla.xfree86.org/show_bug.cgi?id=1344 but I am afraid
that mapping a key to another modifier might cause other trouble, so
let's see what upstream will propose.

It seems that people use altwin:left_meta_win mostly because
altwin:meta_win cancels AltGr, see
  http://bugzilla.xfree86.org/show_bug.cgi?id=1341
But this one can easily be fixed, here is a patch.  All *_win options
are then handled in a similar manner and do not modify Alt keys.

Denis
--- symbols/altwin.orig 2004-04-17 00:46:14.000000000 +0200
+++ symbols/altwin      2004-04-17 00:47:24.000000000 +0200
@@ -10,19 +10,14 @@
 
 partial modifier_keys 
 xkb_symbols "meta_win" {
-    key <LALT> {       [       Alt_L,  Alt_L           ]       };
-    key <RALT> {       [       Alt_R,  Alt_R           ]       };
     key <LWIN> {       [       Meta_L                  ]       };
     key <RWIN> {       [       Meta_R                  ]       };
-    modifier_map Mod1  { Alt_L, Alt_R };
     modifier_map Mod4  { Meta_L, Meta_R };
 };
 
 partial modifier_keys 
 xkb_symbols "left_meta_win" {
-    key <LALT> {       [       Alt_L,  Alt_L           ]       };
     key <LWIN> {       [       Meta_L                  ]       };
-    modifier_map Mod1  { Alt_L };
     modifier_map Mod4  { Meta_L };
 };
 

Reply via email to