Bug#241034: xlibs: Meta key not working in emacs with XkbOptions altwin:left_meta_win

2004-04-17 Thread Felix Kühling
On Sat, 17 Apr 2004 00:50:58 +0200
[EMAIL PROTECTED] (Denis Barbier) wrote:

 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.

Thanks for the explanation. If I understand you correctly then from the
XFree86 point of view this bug is probably a duplicate of #234081.

 
 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

Right, that was the reason why I went with left_meta_win.

 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.

Thanks a lot! I applied your patch in /etc/X11/xkb and am happily using
altwin:meta_win now.

 
 Denis
 

Felix




Bug#241034: xlibs: Meta key not working in emacs with XkbOptions altwin:left_meta_win

2004-04-16 Thread Denis Barbier
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.0 +0200
+++ symbols/altwin  2004-04-17 00:47:24.0 +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 };
 };
 


Bug#241034: xlibs: Meta key not working in emacs with XkbOptions altwin:left_meta_win

2004-03-31 Thread Felix Kühling
On Tue, 30 Mar 2004 21:59:44 +0200
[EMAIL PROTECTED] (Denis Barbier) wrote:

 On Tue, Mar 30, 2004 at 02:51:22PM +0200, Felix Kuehling wrote:
  Package: xlibs
  Version: 4.3.0-7
  Severity: normal
  
  The meta key stopped working after upgrading to XFree86 4.3. This is with
  XkbOptions set to altwin:left_meta_win, compose:menu. It used to work with
  XFree86 4.2.x. The left windows-key was Meta.
 [...]
  I made some experiments with xev, once with 
  altwin:left_meta_win,compose:menu,
  once without it. It's funny that Alt_L+X produces the same result in both
  cases, but with the XkbOptions emacs doesn't recognize Alt_L+X. :-/
 
 Are these keys working right in xterm?  If yes, this is most likely an
 emacs problem, it looks similar to
   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=165814msg=7

Hmm. It does work in xterm. In gnome-terminal I have to use Alt_L as
Meta-key though.

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.

And it's not a problem with the Xserver itself, because the problem also
occurs with a self-built server from the DRI project that I was using
before the XFree86 upgrade without problems.

 
 Denis

Felix



Bug#241034: xlibs: Meta key not working in emacs with XkbOptions altwin:left_meta_win

2004-03-30 Thread Felix Kuehling
Package: xlibs
Version: 4.3.0-7
Severity: normal

The meta key stopped working after upgrading to XFree86 4.3. This is with
XkbOptions set to altwin:left_meta_win, compose:menu. It used to work with
XFree86 4.2.x. The left windows-key was Meta.

When I remove the XkbOptions I can use left-Alt as Meta key. When I use
altwin:meta_win, the windows key works as Meta, but the AltGr key becomes
Alt_R and I can't access the 3rd mapping of certain keys (making the german
keyboard useless). That's why I really want to use the left_alt_meta option.

Here is the relevant part of my XF86Config-4:

Section InputDevice
Identifier  Generic Keyboard
Driver  keyboard
Option  CoreKeyboard
Option  XkbRules  xfree86
Option  XkbModel  pc105
Option  XkbLayout de
#   Option  XkbOptionsaltwin:left_meta_win, compose:menu
#   Option  XkbOptionsaltwin:meta_win
EndSection

I made some experiments with xev, once with altwin:left_meta_win,compose:menu,
once without it. It's funny that Alt_L+X produces the same result in both
cases, but with the XkbOptions emacs doesn't recognize Alt_L+X. :-/

= XkbOptions altwin:left_meta_win, compose:menu =

Meta-combinations in emacs don't work. Any more. With XFree86 4.2.x
it used to work with the left Windoze key as Meta.

== Alt_L+X ==

KeyPress event, serial 24, synthetic NO, window 0x261,
root 0x3f, subw 0x0, time 92983, (240,156), root:(245,202),
state 0x0, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
XLookupString gives 0 bytes:  
 
KeyPress event, serial 24, synthetic NO, window 0x261,
root 0x3f, subw 0x0, time 93296, (240,156), root:(245,202),
state 0x8, keycode 53 (keysym 0x78, x), same_screen YES,
XLookupString gives 1 bytes:  x
 
KeyRelease event, serial 24, synthetic NO, window 0x261,
root 0x3f, subw 0x0, time 93344, (240,156), root:(245,202),
state 0x8, keycode 53 (keysym 0x78, x), same_screen YES,
XLookupString gives 1 bytes:  x
 
KeyRelease event, serial 24, synthetic NO, window 0x261,
root 0x3f, subw 0x0, time 93475, (240,156), root:(245,202),
state 0x8, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
XLookupString gives 0 bytes:  

== Windows+X ==
 
KeyPress event, serial 24, synthetic NO, window 0x261,
root 0x3f, subw 0x0, time 95422, (240,156), root:(245,202),
state 0x0, keycode 115 (keysym 0xffe7, Meta_L), same_screen YES,
XLookupString gives 0 bytes:  
 
KeyPress event, serial 24, synthetic NO, window 0x261,
root 0x3f, subw 0x0, time 95771, (240,156), root:(245,202),
state 0x40, keycode 53 (keysym 0x78, x), same_screen YES,
XLookupString gives 1 bytes:  x
 
KeyRelease event, serial 24, synthetic NO, window 0x261,
root 0x3f, subw 0x0, time 95864, (240,156), root:(245,202),
state 0x40, keycode 53 (keysym 0x78, x), same_screen YES,
XLookupString gives 1 bytes:  x
 
KeyRelease event, serial 24, synthetic NO, window 0x261,
root 0x3f, subw 0x0, time 95916, (240,156), root:(245,202),
state 0x40, keycode 115 (keysym 0xffe7, Meta_L), same_screen YES,
XLookupString gives 0 bytes:  

= No XkbOptions =

Meta combinations in Emacs work, with the left Alt key as Meta.

== Alt_L+X ==

KeyPress event, serial 24, synthetic NO, window 0x261,
root 0x3f, subw 0x0, time 24829, (444,229), root:(449,275),
state 0x0, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
XLookupString gives 0 bytes:  

KeyPress event, serial 24, synthetic NO, window 0x261,
root 0x3f, subw 0x0, time 25232, (444,229), root:(449,275),
state 0x8, keycode 53 (keysym 0x78, x), same_screen YES,
XLookupString gives 1 bytes:  x

KeyRelease event, serial 24, synthetic NO, window 0x261,
root 0x3f, subw 0x0, time 25385, (444,229), root:(449,275),
state 0x8, keycode 53 (keysym 0x78, x), same_screen YES,
XLookupString gives 1 bytes:  x

KeyRelease event, serial 24, synthetic NO, window 0x261,
root 0x3f, subw 0x0, time 25411, (444,229), root:(449,275),
state 0x8, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
XLookupString gives 0 bytes:  

= Windows+X ==

KeyPress event, serial 24, synthetic NO, window 0x261,
root 0x3f, subw 0x0, time 26413, (444,229), root:(449,275),
state 0x0, keycode 115 (keysym 0xffeb, Super_L), same_screen YES,
XLookupString gives 0 bytes:  

KeyPress event, serial 24, synthetic NO, window 0x261,
root 0x3f, subw 0x0, time 26746, (444,229), root:(449,275),
state 0x40, keycode 53 (keysym 0x78, x), same_screen YES,
XLookupString gives 1 bytes:  x

KeyRelease event, serial 24, synthetic NO, window 0x261,
root 0x3f, subw 0x0, time 26862, (444,229), root:(449,275),
state 0x40, keycode 53 (keysym 0x78, x), same_screen YES,
XLookupString gives 1 bytes:  x

KeyRelease event, serial 24, synthetic NO, window 0x261,
root 0x3f, subw 

Bug#241034: xlibs: Meta key not working in emacs with XkbOptions altwin:left_meta_win

2004-03-30 Thread Denis Barbier
On Tue, Mar 30, 2004 at 02:51:22PM +0200, Felix Kuehling wrote:
 Package: xlibs
 Version: 4.3.0-7
 Severity: normal
 
 The meta key stopped working after upgrading to XFree86 4.3. This is with
 XkbOptions set to altwin:left_meta_win, compose:menu. It used to work with
 XFree86 4.2.x. The left windows-key was Meta.
[...]
 I made some experiments with xev, once with altwin:left_meta_win,compose:menu,
 once without it. It's funny that Alt_L+X produces the same result in both
 cases, but with the XkbOptions emacs doesn't recognize Alt_L+X. :-/

Are these keys working right in xterm?  If yes, this is most likely an
emacs problem, it looks similar to
  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=165814msg=7

Denis