Index: configure.in
===================================================================
RCS file: /cvs/gnome/rhythmbox/configure.in,v
retrieving revision 1.50
diff -u -r1.50 configure.in
--- configure.in	11 May 2003 05:28:16 -0000	1.50
+++ configure.in	11 May 2003 11:51:11 -0000
@@ -26,7 +26,7 @@
 
 GNOME_COMPILE_WARNINGS(error)
 
-MONKEYMEDIA_REQUIRED=0.6.1.99
+MONKEYMEDIA_REQUIRED=0.6.1
 
 AC_SUBST(MONKEYMEDIA_REQUIRED)
 
@@ -46,6 +46,14 @@
 dnl 			[ RHYTHMBOX_LIBS="$RHYTHMBOX_LIBS -llirc_client"
 dnl 			AC_DEFINE(HAVE_REMOTE)]
 dnl 			,,) ] ,)
+
+dnl Check of Mulitmedia keys
+AC_ARG_ENABLE(acme, 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,,[Define if we have the Acme key daemon])])
+fi
 
 AC_SUBST(RHYTHMBOX_CFLAGS)
 AC_SUBST(RHYTHMBOX_LIBS)
Index: shell/rb-shell-player.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/shell/rb-shell-player.c,v
retrieving revision 1.33
diff -u -r1.33 rb-shell-player.c
--- shell/rb-shell-player.c	11 May 2003 05:28:15 -0000	1.33
+++ shell/rb-shell-player.c	11 May 2003 11:51:13 -0000
@@ -43,6 +43,9 @@
 #include "rb-player.h"
 #include "rb-remote.h"
 #include "eel-gconf-extensions.h"
+#ifdef HAVE_ACME
+#include <X11/XF86keysym.h>
+#endif
 
 typedef enum
 {
@@ -1433,3 +1436,35 @@
 
 	gdk_threads_leave ();
 }
+
+#ifdef HAVE_ACME
+gboolean
+rb_shell_player_handle_key (RBShellPlayer *player, guint keyval)
+{
+	gboolean retval = TRUE;
+
+        rb_debug ("handling key %ud", keyval);
+        switch (keyval) {
+        case XF86XK_AudioPlay:
+        case XF86XK_AudioPause:
+        	if (!player->priv->mmplayer)
+              		break;
+                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);
+                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.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/shell/rb-shell.c,v
retrieving revision 1.103
diff -u -r1.103 rb-shell.c
--- shell/rb-shell.c	11 May 2003 05:28:15 -0000	1.103
+++ shell/rb-shell.c	11 May 2003 11:51:15 -0000
@@ -160,6 +160,12 @@
 			                  guint cnxn_id,
 			                  GConfEntry *entry,
 			                  RBShell *shell);
+#ifdef HAVE_ACME
+static int
+rb_shell_window_key_press_cb (GtkWidget *win, GdkEventKey *event,
+                               gpointer user_data);
+#endif
+
 #ifdef HAVE_AUDIOCD
 /* static void audiocd_changed_cb (MonkeyMediaAudioCD *cd, */
 /* 				gboolean available, */
@@ -549,6 +555,15 @@
 			  G_CALLBACK (rb_shell_window_delete_cb),
 			  shell);
 
+#ifdef HAVE_ACME
+         /* Connect the keys */
+        rb_debug ("adding key_press_event callback");
+        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_shell_window_key_press_cb), 
+                         shell);
+#endif
+
 	rb_debug ("shell: creating container area");
 	shell->priv->container = bonobo_window_get_ui_container (win);
 
@@ -1714,3 +1729,24 @@
 	bonobo_ui_component_set_tree (pcomp, "/", node, NULL);
 	bonobo_ui_node_free (node);
 }
+
+#ifdef HAVE_ACME
+static int
+rb_shell_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_shell_player_handle_key (shell->priv->player_shell, event->keyval);
+}
+#endif
