Index: acconfig.h
===================================================================
RCS file: /cvs/gnome/net-rhythmbox/acconfig.h,v
retrieving revision 1.2
diff -u -r1.2 acconfig.h
--- acconfig.h	26 Apr 2003 01:23:02 -0000	1.2
+++ acconfig.h	9 May 2003 08:05:36 -0000
@@ -3,3 +3,4 @@
 #undef HAVE_GETTEXT
 #undef GETTEXT_PACKAGE
 #undef HAVE_LC_MESSAGES
+#undef HAVE_ACME
Index: configure.ac
===================================================================
RCS file: /cvs/gnome/net-rhythmbox/configure.ac,v
retrieving revision 1.2
diff -u -r1.2 configure.ac
--- configure.ac	2 May 2003 02:14:51 -0000	1.2
+++ configure.ac	9 May 2003 08:05:36 -0000
@@ -86,6 +86,15 @@
 			,,) ] ,)
 fi
 
+dnl Check of Mulitmedia keys
+AC_ARG_ENABLE(xacme, AC_HELP_STRING([--disable-acme],
+				[don't build with acme support]))
+if test "x$enable_acme" != "xno"; then
+AC_CHECK_HEADER(X11/XF86keysym.h, [enable_acme=yes
+		AC_DEFINE(HAVE_ACME)],,)
+fi
+
+
 dnl Check for zlib
 
 AC_CHECK_HEADER(zlib.h,,
Index: shell/rb-shell-player.c
===================================================================
RCS file: /cvs/gnome/net-rhythmbox/shell/rb-shell-player.c,v
retrieving revision 1.28
diff -u -r1.28 rb-shell-player.c
--- shell/rb-shell-player.c	7 May 2003 04:44:14 -0000	1.28
+++ shell/rb-shell-player.c	9 May 2003 08:05:41 -0000
@@ -45,6 +45,9 @@
 #include "rb-player.h"
 #include "rb-remote.h"
 #include "eel-gconf-extensions.h"
+#ifdef HAVE_ACME
+#include <X11/XF86keysym.h>
+#endif
 
 #define RB_SHELL_PLAYER_REMOTE_SEEK_INTERVAL 10
 
@@ -138,6 +141,10 @@
 				       RBShellPlayer *player);
 #endif
 
+#ifdef HAVE_ACME
+static void rb_pause_or_play (RBShellPlayer *player);
+#endif
+
 #define MENU_PATH_PLAY     "/menu/Controls/Play"
 #define TRAY_PATH_PLAY     "/popups/TrayPopup/Play"
 #define TOOLBAR_PATH_PLAY  "/Toolbar/Play"
@@ -1564,3 +1571,51 @@
 	}
 }
 #endif
+
+
+#ifdef HAVE_ACME
+static void
+rb_pause_or_play (RBShellPlayer *player)
+{
+ 	if (player != NULL)
+ 	{
+		if (monkey_media_player_playing (player->priv->mmplayer))
+		{
+			rb_shell_player_cmd_pause (NULL, player, NULL);
+		}
+		else
+		{
+			rb_shell_player_cmd_play (NULL, player, NULL);
+		}
+ 	}
+}
+#endif
+
+#ifdef HAVE_ACME
+gboolean
+rb_player_action_handle_key (RBShellPlayer *player, guint keyval)
+{
+ 	gboolean retval = TRUE;
+ 	switch (keyval) {
+ 	case XF86XK_AudioPlay:
+ 	case XF86XK_AudioPause:
+ 		rb_pause_or_play (player);
+ 		break;
+ 	case XF86XK_AudioPrev:
+		if (rb_shell_player_have_previous (player, player->priv->selected_source) == TRUE)
+		{
+ 			rb_shell_player_previous (player);
+		}
+ 		break;
+ 	case XF86XK_AudioNext:
+	    	if (rb_shell_player_have_next (player, player->priv->selected_source) == TRUE)
+		{
+			rb_shell_player_next (player);
+		}
+ 		break;
+ 	default:
+ 		retval = FALSE;
+ 	}
+ 	return retval;
+}
+#endif 
Index: shell/rb-shell-player.h
===================================================================
RCS file: /cvs/gnome/net-rhythmbox/shell/rb-shell-player.h,v
retrieving revision 1.2
diff -u -r1.2 rb-shell-player.h
--- shell/rb-shell-player.h	1 May 2003 00:46:58 -0000	1.2
+++ shell/rb-shell-player.h	9 May 2003 08:05:42 -0000
@@ -75,6 +75,9 @@
 MonkeyMediaPlayer *	rb_shell_player_get_mm_player(RBShellPlayer *shell_player);
 
 gboolean		rb_shell_player_get_playing(RBShellPlayer *shell_player);
+#ifdef HAVE_ACME
+gboolean rb_player_action_handle_key (RBShellPlayer *player, guint keyval);
+#endif
 
 G_END_DECLS
 
Index: shell/rb-shell.c
===================================================================
RCS file: /cvs/gnome/net-rhythmbox/shell/rb-shell.c,v
retrieving revision 1.21
diff -u -r1.21 rb-shell.c
--- shell/rb-shell.c	2 May 2003 07:45:33 -0000	1.21
+++ shell/rb-shell.c	9 May 2003 08:05:44 -0000
@@ -229,6 +229,10 @@
 static void rb_shell_remote_cb (RBRemote *remote, RBRemoteCommand cmd,
 				RBShell *shell);
 #endif
+#ifdef HAVE_ACME
+static int rb_window_key_press_cb (GtkWidget *win, GdkEventKey *event,
+                        gpointer user_data);
+#endif
 
 static const GtkTargetEntry target_table[] =
 	{
@@ -711,6 +715,13 @@
 	g_signal_connect (G_OBJECT (win), "delete_event",
 			  G_CALLBACK (rb_shell_window_delete_cb),
 			  shell);
+#ifdef HAVE_ACME
+	/* Connect the keys */
+	gtk_widget_add_events (shell->priv->window, GDK_KEY_PRESS_MASK);
+	g_signal_connect (G_OBJECT(shell->priv->window), "key_press_event",
+			G_CALLBACK (rb_window_key_press_cb), 
+			shell);
+#endif
 
 	rb_debug ("shell: creating echo area");
 	shell->priv->echoarea = rb_echo_area_new ();
@@ -2268,3 +2279,26 @@
 	}
 }
 #endif
+
+#ifdef HAVE_ACME
+static int
+rb_window_key_press_cb (GtkWidget *win, GdkEventKey *event,
+                        gpointer user_data)
+{
+	RBShell *shell = RB_SHELL (user_data);
+
+	if (event->state != 0
+	            && ((event->state & GDK_CONTROL_MASK)
+	                || (event->state & GDK_MOD1_MASK)
+	                || (event->state & GDK_MOD3_MASK)
+	                || (event->state & GDK_MOD4_MASK)
+	                || (event->state & GDK_MOD5_MASK)))
+	{
+		return FALSE;
+	}
+
+	return rb_player_action_handle_key (shell->priv->player_shell, event->keyval);
+}
+#endif
+