Index: apps/plugin.h
===================================================================
RCS file: /cvsroot/rockbox/apps/plugin.h,v
retrieving revision 1.165
diff -p -u -d -r1.165 plugin.h
--- apps/plugin.h	16 Mar 2006 17:06:20 -0000	1.165
+++ apps/plugin.h	17 Mar 2006 01:14:27 -0000
@@ -228,8 +229,11 @@ struct plugin_api {
     long (*button_get)(bool block);
     long (*button_get_w_tmo)(int ticks);
     int (*button_status)(void);
+#if CONFIG_KEYPAD == IPOD_4G_PAD && ! defined(SIMULATOR)
+    int (*wheel_status)(void);
+#endif
     void (*button_clear_queue)(void);
-#if CONFIG_KEYPAD == IRIVER_H100_PAD
+#if CONFIG_KEYPAD == IRIVER_H100_PAD
     bool (*button_hold)(void);
 #endif
 
Index: apps/plugin.c
===================================================================
RCS file: /cvsroot/rockbox/apps/plugin.c,v
retrieving revision 1.150
diff -p -u -d -r1.150 plugin.c
--- apps/plugin.c	18 Feb 2006 20:51:33 -0000	1.150
+++ apps/plugin.c	24 Feb 2006 05:12:54 -0000
@@ -181,8 +182,11 @@ static const struct plugin_api rockbox_a
     button_get,
     button_get_w_tmo,
     button_status,
+#if CONFIG_KEYPAD == IPOD_4G_PAD && ! defined (SIMULATOR)
+    wheel_status,
+#endif
     button_clear_queue,
-#if CONFIG_KEYPAD == IRIVER_H100_PAD
+#if CONFIG_KEYPAD == IRIVER_H100_PAD
     button_hold,
 #endif
 
Index: firmware/drivers/button.c
===================================================================
RCS file: /cvsroot/rockbox/firmware/drivers/button.c,v
retrieving revision 1.128
diff -p -u -d -r1.128 button.c
--- firmware/drivers/button.c	10 Mar 2006 12:55:13 -0000	1.128
+++ firmware/drivers/button.c	17 Mar 2006 01:14:28 -0000
@@ -87,6 +87,7 @@ static bool remote_button_hold_only(void
 #if CONFIG_KEYPAD == IPOD_4G_PAD
 /* Variable to use for setting button status in interrupt handler */
 int int_btn = BUTTON_NONE;
+int int_wheel = -1;
 #endif
 
 #if (CONFIG_KEYPAD == IPOD_4G_PAD) && (!defined(APPLE_IPODMINI))
@@ -124,6 +125,8 @@ static void opto_i2c_init(void)
 
 static int ipod_4g_button_read(void)
 {
+    int whl = -1;
+    
     /* The ipodlinux source had a udelay(250) here, but testing has shown that
        it is not needed - tested on Nano, Color/Photo and Video. */
     /* udelay(250);*/
@@ -153,6 +156,7 @@ static int ipod_4g_button_read(void)
             if (status & 0x40000000) {
                 /* NB: highest wheel = 0x5F, clockwise increases */
                 int new_wheel_value = ((status << 9) >> 25) & 0xff;
+                whl = new_wheel_value;
 
                 /* scroll wheel down */
                 clickwheel_down = 1;
@@ -219,6 +223,7 @@ static int ipod_4g_button_read(void)
         outl(0xffffffff, 0x7000c120);
         outl(0xffffffff, 0x7000c124);
     }
+    int_wheel = whl;
     return btn;
 }
 
@@ -1281,6 +1286,13 @@ int button_status(void)
     return lastbtn;
 }
 
+#if (CONFIG_KEYPAD == IPOD_4G_PAD)
+int wheel_status(void)
+{
+    return int_wheel;
+}
+#endif
+
 void button_clear_queue(void)
 {
     queue_clear(&button_queue);
Index: firmware/export/button.h
===================================================================
RCS file: /cvsroot/rockbox/firmware/export/button.h,v
retrieving revision 1.44
diff -p -u -d -r1.44 button.h
--- firmware/export/button.h	9 Mar 2006 07:23:07 -0000	1.44
+++ firmware/export/button.h	17 Mar 2006 01:14:28 -0000
@@ -37,6 +37,9 @@ void button_init (void);
 long button_get (bool block);
 long button_get_w_tmo(int ticks);
 int button_status(void);
+#if (CONFIG_KEYPAD == IPOD_4G_PAD) && ! defined(SIMULATOR)
+int wheel_status(void);
+#endif
 void button_clear_queue(void);
 #ifdef HAVE_LCD_BITMAP
 void button_set_flip(bool flip); /* turn 180 degrees */
