linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] input/mouse/alps.c: Handle touchpoints buttons correctly
@ 2008-11-17  1:42 Ulrich Dangel
  0 siblings, 0 replies; only message in thread
From: Ulrich Dangel @ 2008-11-17  1:42 UTC (permalink / raw)
  To: linux-input; +Cc: linux-kernel, Dmitry Torokhov

When pressing any button belonging to the touchpoint, the generated click
events dont belong to the touchpoint but to the touchpad.

This patch fixes this behaviour, the events will be sent via the correct
device, so scrolling with touchpoint is possible.

The patch compiles cleanly and has been tested successfully on my
machine.

Signed-off-by: Ulrich Dangel <uli@spamt.net>

---

 alps.c |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)


--- a/drivers/input/mouse/alps.c    2008-10-26 00:05:07.000000000 +0200
+++ b/drivers/input/mouse/alps.c    2008-11-17 01:22:03.738057264 +0100
@@ -130,18 +130,23 @@ static void alps_process_packet(struct p
    ges = packet[2] & 1;
    fin = packet[2] & 2;

-   input_report_key(dev, BTN_LEFT, left);
-   input_report_key(dev, BTN_RIGHT, right);
-   input_report_key(dev, BTN_MIDDLE, middle);
-
    if ((priv->i->flags & ALPS_DUALPOINT) && z == 127) {
        input_report_rel(dev2, REL_X,  (x > 383 ? (x - 768) : x));
        input_report_rel(dev2, REL_Y, -(y > 255 ? (y - 512) : y));
+
+       input_report_key(dev2, BTN_LEFT, left);
+       input_report_key(dev2, BTN_RIGHT, right);
+       input_report_key(dev2, BTN_MIDDLE, middle);
+
        input_sync(dev);
        input_sync(dev2);
        return;
    }

+   input_report_key(dev, BTN_LEFT, left);
+   input_report_key(dev, BTN_RIGHT, right);
+   input_report_key(dev, BTN_MIDDLE, middle);
+
    /* Convert hardware tap to a reasonable Z value */
    if (ges && !fin) z = 40;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-11-17  1:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-17  1:42 [PATCH] input/mouse/alps.c: Handle touchpoints buttons correctly Ulrich Dangel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).