diff src/event-Xt.c @ 5557:53c066311921

If XLookupKeysym() returned an XFree86 "special key", ignore it. Fixes Sh-F11. src/ChangeLog addition: 2011-08-27 Aidan Kehoe <kehoea@parhasard.net> * config.h.in: Make HAVE_X11_XF86KEYSYM_H available here. * event-Xt.c: #include X11/XF86keysym.h if available. * event-Xt.c (x_event_to_emacs_event): If XLookupKeysym () returned one of the XFree86 "special action keys" for the shifted keysym, treat that as NoSymbol, fixing a long-standing bug with shifted function keys under X.org. Details of why in: http://mid.gmane.org/16960.15685.26911.644835@parhasard.net ChangeLog addition: 2011-08-27 Aidan Kehoe <kehoea@parhasard.net> * configure.ac: Check whether X11/XF86keysym.h is available, to allow us to avoid a bug in the interaction of XKB and XLookupKeysym. * configure: Regenerate.
author Aidan Kehoe <kehoea@parhasard.net>
date Sat, 27 Aug 2011 20:35:23 +0100
parents 308d34e9f07d
children 10455659ab64
line wrap: on
line diff
--- a/src/event-Xt.c	Wed Aug 24 23:41:29 2011 +0100
+++ b/src/event-Xt.c	Sat Aug 27 20:35:23 2011 +0100
@@ -66,6 +66,10 @@
 #include "xmotif.h"
 #endif
 
+#ifdef HAVE_X11_XF86KEYSYM_H
+#include <X11/XF86keysym.h>
+#endif
+
 #ifdef HAVE_DRAGNDROP
 #include "dragdrop.h"
 #endif
@@ -1230,6 +1234,21 @@
 		int Mode_switch_p = *state & xd->ModeMask;
 		KeySym bot = XLookupKeysym (ev, Mode_switch_p ? 2 : 0);
 		KeySym top = XLookupKeysym (ev, Mode_switch_p ? 3 : 1);
+
+#ifdef HAVE_X11_XF86KEYSYM_H
+                /* XLookupKeysm() and XLookupString() differ for these
+                   keysyms under X.org. The latter treats them as not
+                   visible to X11 apps (so if the event has the shift
+                   modifer, the keysym of the unshifted key will be
+                   returned) while the former treats them as visible. We
+                   chose to follow XLookupString in x_to_emacs_keysym(), so
+                   we need to do that here, too. */
+
+                if (XF86XK_Switch_VT_1 <= top && top <= XF86XK_Prev_VMode)
+                  {
+                    top = NoSymbol; 
+                  }
+#endif
 		if (top && bot && top != bot)
 		  modifiers &= ~XEMACS_MOD_SHIFT;
 	      }