Unlike the ACME rodent, the mouse pad of the Rii RF mini-keyboard
sends reports with report ID and 16 bit resolution. This patch just
identifies these reports by their sheer size and then rearranges the
packet content before further processing.
---
 softusb-input/main.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/softusb-input/main.c b/softusb-input/main.c
index de03efe..d27cf14 100644
--- a/softusb-input/main.c
+++ b/softusb-input/main.c
@@ -337,6 +337,16 @@ static void poll(struct ep_status *ep, char keyboard)
        } else {
                if(len < 6)
                        return;
+               /*
+                * HACK: The Rii RF mini-keyboard sends ten byte messages with
+                * a report ID and 16 bit coordinates. We're too lazy to parse
+                * report descriptors, so we just hard-code that report layout.
+                */
+               if(len == 10) {
+                       usb_buffer[1] = usb_buffer[2];  /* buttons */
+                       usb_buffer[2] = usb_buffer[3];  /* X LSB */
+                       usb_buffer[3] = usb_buffer[5];  /* Y LSB */
+               }
                if(len > 7)
                        len = 7;
                m = COMLOC_MEVT_PRODUCE;
-- 
1.7.0.4

_______________________________________________
http://lists.milkymist.org/listinfo.cgi/devel-milkymist.org
IRC: #milkymist@Freenode

Reply via email to