Index: apps/plugins/pacbox/pacbox.c
===================================================================
RCS file: /cvsroot/rockbox/apps/plugins/pacbox/pacbox.c,v
retrieving revision 1.7
diff -p -u -d -r1.7 pacbox.c
--- apps/plugins/pacbox/pacbox.c	16 Mar 2006 23:21:47 -0000	1.7
+++ apps/plugins/pacbox/pacbox.c	17 Mar 2006 02:18:37 -0000
@@ -189,7 +234,9 @@ static bool pacbox_menu(void)
     
     m = rb->menu_init(items, sizeof(items) / sizeof(*items),
                       NULL, NULL, NULL, NULL);
-
+#if (CONFIG_KEYPAD == IPOD_4G_PAD)
+    rb->wheel_send_events(true);
+#endif
     rb->button_clear_queue();
 
     while (!menu_quit) {
@@ -248,6 +295,9 @@ static bool pacbox_menu(void)
     }
 
     rb->menu_exit(m);
+#if (CONFIG_KEYPAD == IPOD_4G_PAD)
+    rb->wheel_send_events(false);
+#endif
 
     if (need_restart) {
         init_PacmanMachine(settings_to_dip(settings));
@@ -294,6 +344,20 @@ static int gameProc( void )
         if (x == 1) { return 1; }
         start_time += *rb->current_tick-end_time;
     }
+#if (CONFIG_KEYPAD == IPOD_4G_PAD)
+    int wheel = rb->wheel_status(); //-1 means the wheel isnt touched
+    if (wheel >= 0 && wheel < 96) {
+    wheel = (wheel+12-24)%96; //rotate the wheel a bit
+        if (wheel < 24)
+            status |= PACMAN_UP;
+        else if (wheel < 48)
+            status |= PACMAN_RIGHT;
+        else if (wheel < 72)
+            status |= PACMAN_DOWN;
+        else if (wheel < 96)
+            status |= PACMAN_LEFT;
+    }
+#endif
 
     setDeviceMode( Joy1_Left, (status & PACMAN_LEFT) ? DeviceOn : DeviceOff);
     setDeviceMode( Joy1_Right, (status & PACMAN_RIGHT) ? DeviceOn : DeviceOff);
@@ -376,6 +440,10 @@ enum plugin_status plugin_start(struct p
     settings.ghostnames = 0; /* Normal names */
     settings.showfps = 0;    /* Do not show FPS */
 
+#if (CONFIG_KEYPAD == IPOD_4G_PAD)
+    rb->wheel_send_events(false);
+#endif
+
     configfile_init(rb);
 
     if (configfile_load(SETTINGS_FILENAME, config,

