Index: configure.ac
===================================================================
RCS file: /cvs/gnome/epiphany/configure.ac,v
retrieving revision 1.43
diff -p -u -u -p -r1.43 configure.ac
--- configure.ac	1 Jan 2005 20:54:17 -0000	1.43
+++ configure.ac	3 Jan 2005 00:24:56 -0000
@@ -473,6 +473,12 @@ if test "x$filepicker" = "xyes"; then
 	AC_DEFINE([ENABLE_FILEPICKER],[1],[Define to enable the native filepicker])
 fi
 
+dnl ***************
+dnl Multimedia keys
+dnl ***************
+
+AC_CHECK_HEADERS([X11/XF86keysym.h])
+
 dnl *******************************
 dnl Add warning flags
 dnl *******************************
Index: src/ephy-window.c
===================================================================
RCS file: /cvs/gnome/epiphany/src/ephy-window.c,v
retrieving revision 1.245
diff -p -u -u -p -r1.245 ephy-window.c
--- src/ephy-window.c	24 Dec 2004 13:49:33 -0000	1.245
+++ src/ephy-window.c	3 Jan 2005 00:24:58 -0000
@@ -66,6 +66,10 @@
 #include <gtk/gtkdialog.h>
 #include <gtk/gtkmessagedialog.h>
 
+#ifdef HAVE_X11_XF86KEYSYM_H
+#include <X11/XF86keysym.h>
+#endif
+
 static void ephy_window_class_init		(EphyWindowClass *klass);
 static void ephy_window_init			(EphyWindow *gs);
 static void ephy_window_finalize		(GObject *object);
@@ -743,43 +747,63 @@ ephy_window_key_press_event (GtkWidget *
 	guint modifier = 0;
 	guint mask = gtk_accelerator_get_default_mod_mask ();
 	char *accel = NULL;
+	gboolean handled = FALSE;
 
 	/* Don't activate menubar in ppv mode */
-	if (window->priv->ppv_mode)
+	if (window->priv->ppv_mode == FALSE)
 	{
-		return FALSE;
+		g_object_get (gtk_widget_get_settings (widget),
+			"gtk-menu-bar-accel", &accel,
+			NULL);
+	
+		if (accel != NULL)
+		{
+			gtk_accelerator_parse (accel, &keyval, &modifier);
+	
+			g_free (accel);
+		}
+	
+		/* Show and activate the menubar, if it isn't visible */
+		if (event->keyval == keyval && (event->state & mask) == (modifier & mask))
+		{
+			menubar = gtk_ui_manager_get_widget (window->priv->manager, "/menubar");
+			g_return_val_if_fail (menubar != NULL , FALSE);
+		
+			if (!GTK_WIDGET_VISIBLE (menubar))
+			{
+				g_signal_connect (menubar, "deactivate",
+						G_CALLBACK (menubar_deactivate_cb), window);
+	
+				gtk_widget_show (menubar);
+				gtk_menu_shell_select_first (GTK_MENU_SHELL (menubar), FALSE);
+	
+				handled = TRUE;
+			}
+		}
 	}
 
-	g_object_get (gtk_widget_get_settings (widget),
-		      "gtk-menu-bar-accel", &accel,
-		      NULL);
-
-	if (accel != NULL)
+#ifdef HAVE_X11_XF86KEYSYM_H
+	if (handled == FALSE && (event->state & mask) == 0)
 	{
-		gtk_accelerator_parse (accel, &keyval, &modifier);
-
-		g_free (accel);
+		if (event->keyval == XF86XK_Back)
+		{
+			ephy_embed_go_back (ephy_window_get_active_embed (window));
+		}
+		else if (event->keyval == XF86XK_Forward)
+		{
+			ephy_embed_go_forward (ephy_window_get_active_embed (window));
+		}
+		/* should we also handle XF86XK_{HomePage,Search,Stop,Refresh,Favorites,History,OpenURL,AddFavorit,HotLinks,ZoomIn,ZoomOut} ?
+		 * also, what about XF86XK_{Copy,Paste,Cut} ? */
 	}
+#endif /* HAVE_XORG */
 
-	/* Show and activate the menubar, if it isn't visible */
-        if (event->keyval == keyval && (event->state & mask) == (modifier & mask))
+	if (handled == FALSE)
 	{
-		menubar = gtk_ui_manager_get_widget (window->priv->manager, "/menubar");
-		g_return_val_if_fail (menubar != NULL , FALSE);
-	
-		if (!GTK_WIDGET_VISIBLE (menubar))
-		{
-			g_signal_connect (menubar, "deactivate",
-					  G_CALLBACK (menubar_deactivate_cb), window);
-
-			gtk_widget_show (menubar);
-			gtk_menu_shell_select_first (GTK_MENU_SHELL (menubar), FALSE);
-
-			return TRUE;
-		}
-        }
+		handled = GTK_WIDGET_CLASS (parent_class)->key_press_event (widget, event);
+	}
 
-	return GTK_WIDGET_CLASS (parent_class)->key_press_event (widget, event);
+	return handled;
 }
 
 static gboolean
