[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#404932: coming soon



On Tue, 6 Feb 2007 19:39:33 +0100, Mattia Dongili wrote:
>On Tue, Feb 06, 2007 at 10:23:35AM +0200, Leonard Norrgard wrote:
>> I've got a basic package done, coming soon.
>
>Humm, did you already see my work?
>http://oioio.altervista.org and look for the git repo.
>
>Anyway, I've been working with upstream for the last month to improve
>build-ability and the driver itself[1] and he will soon release version
>0.8.2 which I'd like to push into debian repos.

That's very good news! I simply misread #404932 as a wish for it to be
packaged (probably from the severity: wishlist).

I'd be happy to help test your package as well and of course prefer to
use that rather than doing a separate ad-hoc package for KVM only.

Your git repo seems to be unavailable.  So far my work is simply
upstream 0.8.1, plus Anthony Liguori's patch (below) to support
scrollwheels and a middle button.  You may have incorporated this
patch already.

This driver has a big usecase as a mouse driver in virtualized
GNU/Linux guests that are run with QEMU or KVM (I'm co-maintaining KVM
in Debian).  I'm hoping to include this driver (or a simple way to
download it in Etch guests) in the next Debian KVM upload (we have
nearly weekly uploads due to the fast rate of development right now,
so a replacement can be inserted quickly as well - the kvm package
itself isn't in Etch).

-- Leonard


Written by: Anthony Liguori <anthony@codemonkey.ws>
License: same as package (verified)
Description: Enables both the middle button and scroll wheel.
From: http://www.cs.utexas.edu/users/aliguori/evtouch-middle-scroll.diff
Announcement: http://lists.gnu.org/archive/html/qemu-devel/2006-04/msg00292.html

diff -ur a/evtouch.c b/evtouch.c
--- a/evtouch.c	2005-10-30 05:59:36.000000000 -0600
+++ b/evtouch.c	2006-04-14 20:18:00.000000000 -0500
@@ -215,6 +215,35 @@
         if (ev->code == ABS_Y) 
                 priv->cur_y = ev->value;
 
+	if (ev->code == ABS_WHEEL) {
+		int value = ev->value;
+		LocalDevicePtr local = priv->local;
+
+		if (value > 0) {
+			for (; value > 0; value--) {
+				xf86PostButtonEvent (local->dev, TRUE,
+						     4, 1, 0, 2, 
+						     priv->cur_x, 
+						     priv->cur_y);
+				xf86PostButtonEvent (local->dev, TRUE,
+						     4, 0, 0, 2, 
+						     priv->cur_x, 
+						     priv->cur_y);
+			}
+		} else if (value < 0) {
+			for (value = -value; value > 0; value--) {
+				xf86PostButtonEvent (local->dev, TRUE,
+						     5, 1, 0, 2, 
+						     priv->cur_x, 
+						     priv->cur_y);
+				xf86PostButtonEvent (local->dev, TRUE,
+						     5, 0, 0, 2, 
+						     priv->cur_x, 
+						     priv->cur_y);
+			}
+		}			
+	}
+
         trigger_sm(priv);
 }
 
@@ -228,7 +257,7 @@
         ev = &priv->ev;
         priv->old_x = priv->cur_x;
         priv->old_y = priv->cur_y;
-        if ( ev->code == ABS_X ) {
+        if ( ev->code == REL_X ) {
                 priv->cur_x += ev->value;
                 if (priv->cur_x > priv->max_x)
                         priv->cur_x = priv->max_x;
@@ -236,7 +265,7 @@
                         priv->cur_x = priv->min_x;
                 return;
         } 
-        if ( ev->code == ABS_Y ) {
+        if ( ev->code == REL_Y ) {
                 priv->cur_y += ev->value;
                 if (priv->cur_y > priv->max_y)
                         priv->cur_y = priv->max_y;
@@ -307,6 +336,12 @@
                                             priv->cur_y);
                 }
 
+		if (ev->code == BTN_MIDDLE) {
+			xf86PostButtonEvent(local->dev, TRUE,
+					    2, ev->value, 0, 2,
+					    priv->cur_x,
+					    priv->cur_y);
+		}
 
                 if (ev->code == BTN_RIGHT) {
                         xf86PostButtonEvent (local->dev, TRUE,
@@ -326,7 +361,8 @@
 
         ev = &priv->ev;
         if ( (ev->code == BTN_LEFT) || 
-             (ev->code == BTN_RIGHT) ) {
+             (ev->code == BTN_RIGHT) ||
+             (ev->code == BTN_MIDDLE) ) {
                 /* give lb and rb-events some special treatment 
                    (emulate3 or not, ...) */
                 EVTouchLBRBEvent(priv);
@@ -439,9 +475,8 @@
 {
         LocalDevicePtr local = (LocalDevicePtr) dev->public.devicePrivate;
         EVTouchPrivatePtr priv = (EVTouchPrivatePtr) (local->private);
-        unsigned char map[] = {0, 1, 2, 3};
+        unsigned char map[] = {0, 1, 2, 3, 4, 5};
 
-   
         /* 
          * these have to be here instead of in the SetupProc, because when the
          * SetupProc is run at server startup, screenInfo is not setup yet
@@ -486,9 +521,9 @@
         }
 
         /* 
-         * Device reports button press for 3 buttons.
+         * Device reports button press for 5 buttons.
          */
-        if (InitButtonClassDeviceStruct (dev, 3, map) == FALSE)
+        if (InitButtonClassDeviceStruct (dev, 5, map) == FALSE)
         {
                 ErrorF("Unable to allocate EVTouch touchscreen ButtonClassDeviceStruct\n");
                 return !Success;
diff -ur a/evtouch.h b/evtouch.h
--- a/evtouch.h	2005-10-30 05:59:36.000000000 -0600
+++ b/evtouch.h	2006-04-14 20:02:41.000000000 -0500
@@ -82,12 +82,22 @@
  */
 #define ABS_X			0x00
 #define ABS_Y			0x01
+#define ABS_WHEEL		0x08
+
+/*
+ * Relative axes
+ */
+
+#define REL_X			0x00
+#define REL_Y			0x01
+#define REL_WHEEL		0x08
 
 /*
  * Buttons
  */
 #define BTN_LEFT		0x110
 #define BTN_RIGHT		0x111
+#define BTN_MIDDLE		0x112
 #define BTN_TOUCH		0x14a
 
 #define TOUCHED 0x01



Reply to: