diff src/event-gtk.c @ 2081:e8db6a10ad42

[xemacs-hg @ 2004-05-15 07:31:43 by malcolmp] Added support for Gtk menu bar, menu item and dialog button mnemonics.
author malcolmp
date Sat, 15 May 2004 07:31:49 +0000
parents 91d4c8c65a0f
children 04bc9d2f42c7
line wrap: on
line diff
--- a/src/event-gtk.c	Fri May 14 21:50:44 2004 +0000
+++ b/src/event-gtk.c	Sat May 15 07:31:49 2004 +0000
@@ -58,6 +58,10 @@
 #include "dragdrop.h"
 #endif
 
+#ifdef HAVE_MENUBARS
+# include "menubar.h"
+#endif
+
 #if defined (HAVE_OFFIX_DND)
 #include "offix.h"
 #endif
@@ -1326,6 +1330,22 @@
 	    GdkEventKey *key_event = &gdk_event->key;
 	    Lisp_Object keysym;
 
+#ifdef HAVE_MENUBARS
+	    /* If the user wants see if the event is a menu bar accelerator.
+	       The process of checking absorbs the event and starts menu
+	       processing so send a null event into XEmacs to make sure it
+	       does nothing.
+	    */
+	    if (!NILP (Vmenu_accelerator_enabled)
+		&& gtk_accel_groups_activate(GTK_OBJECT (FRAME_GTK_SHELL_WIDGET(frame)),
+					     key_event->keyval,
+					     (GdkModifierType) *state))
+	      {
+		zero_event(emacs_event);
+		return 1;
+	      }
+#endif
+
 	    /* This used to compute the frame from the given X window and
 	       store it here, but we really don't care about the frame. */
 	    emacs_event->channel = DEVICE_CONSOLE (d);