public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] use multitouch touchpad events as buttons mousedev
@ 2009-03-09  1:03 Lukasz Stelmach
  2009-04-16  2:11 ` Dmitry Torokhov
  0 siblings, 1 reply; 4+ messages in thread
From: Lukasz Stelmach @ 2009-03-09  1:03 UTC (permalink / raw)
  To: LKML

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

- --- drivers/input/mousedev.c~	2009-03-08 15:11:11.000000000 +0100
+++ drivers/input/mousedev.c	2009-03-09 00:27:34.000000000 +0100
@@ -316,7 +316,7 @@
 		wake_up_interruptible(&mousedev->wait);
 }

- -static void mousedev_touchpad_touch(struct mousedev *mousedev, int value)
+static void mousedev_touchpad_touch(struct mousedev *mousedev, unsigned int code, int value)
 {
 	if (!value) {
 		if (mousedev->touch &&
@@ -327,13 +327,23 @@
 			 * We rely on the fact that mousedev_mix always has 0
 			 * motion packet so we won't mess current position.
 			 */
- -			set_bit(0, &mousedev->packet.buttons);
- -			set_bit(0, &mousedev_mix->packet.buttons);
+			int index;
+
+			switch (code) {
+			case BTN_TOOL_DOUBLETAP: index = 1; break;
+
+			case BTN_TOOL_TRIPLETAP: index = 2; break;
+
+			default: index = 0;
+			}
+
+			set_bit(index, &mousedev->packet.buttons);
+			set_bit(index, &mousedev_mix->packet.buttons);
 			mousedev_notify_readers(mousedev, &mousedev_mix->packet);
 			mousedev_notify_readers(mousedev_mix,
 						&mousedev_mix->packet);
- -			clear_bit(0, &mousedev->packet.buttons);
- -			clear_bit(0, &mousedev_mix->packet.buttons);
+			clear_bit(index, &mousedev->packet.buttons);
+			clear_bit(index, &mousedev_mix->packet.buttons);
 		}
 		mousedev->touch = mousedev->pkt_count = 0;
 		mousedev->frac_dx = 0;
@@ -371,7 +381,7 @@
 		if (value != 2) {
 			if (code == BTN_TOUCH &&
 			    test_bit(BTN_TOOL_FINGER, handle->dev->keybit))
- -				mousedev_touchpad_touch(mousedev, value);
+				mousedev_touchpad_touch(mousedev, code, value);
 			else
 				mousedev_key_event(mousedev, code, value);
 		}

Some touchpads can recognize multi-finger taps. They can be used as
additional buttons (left and middle).

	Signed-off-by: Łukasz Stelmach <stlman@poczta.fm>


Please CC any comments.
- --
Było mi bardzo miło.               Czwarta pospolita klęska, [...]
>Łukasz<                 Już nie katolicka lecz złodziejska.  (c)PP
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkm0atoACgkQNdzY8sm9K9z8rQCfQkfJ4xHSEeao6yy9wzz/6zkT
t0kAni6046EHiTmVc7McixxEsrSfJZDS
=w8xZ
-----END PGP SIGNATURE-----


----------------------------------------------------------------------
Udar sloneczny prezesa Kaczynskiego... >>> http://link.interia.pl/f2083


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] use multitouch touchpad events as buttons mousedev
  2009-03-09  1:03 [PATCH] use multitouch touchpad events as buttons mousedev Lukasz Stelmach
@ 2009-04-16  2:11 ` Dmitry Torokhov
  2009-04-18 17:53   ` Lukasz Stelmach
  0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Torokhov @ 2009-04-16  2:11 UTC (permalink / raw)
  To: Lukasz Stelmach; +Cc: LKML

Hi Lukasz,

On Mon, Mar 09, 2009 at 02:03:22AM +0100, Lukasz Stelmach wrote:
> 
> Some touchpads can recognize multi-finger taps. They can be used as
> additional buttons (left and middle).
> 

mousedev is a legacy interface and I don't think this change is needed
since evdev + Synaptics X driver combination works much better with
touchpads anyway.

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] use multitouch touchpad events as buttons mousedev
  2009-04-16  2:11 ` Dmitry Torokhov
@ 2009-04-18 17:53   ` Lukasz Stelmach
  2009-04-18 22:13     ` Dmitry Torokhov
  0 siblings, 1 reply; 4+ messages in thread
From: Lukasz Stelmach @ 2009-04-18 17:53 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: LKML

[-- Attachment #1: Type: text/plain, Size: 1156 bytes --]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dmitry Torokhov pisze:
> Hi Lukasz,
> 
> On Mon, Mar 09, 2009 at 02:03:22AM +0100, Lukasz Stelmach wrote:
>> Some touchpads can recognize multi-finger taps. They can be used as
>> additional buttons (left and middle).
>>
> 
> mousedev is a legacy interface and I don't think this change is needed
> since evdev + Synaptics X driver combination works much better with
> touchpads anyway.

That is true, however, I happen to use plain old virtual terminal with
gpm which uses mousedev. Having that multitouch buttons is, I assure you,
awesome.

- --
Było mi bardzo miło.               Czwarta pospolita klęska, [...]
>Łukasz<                 Już nie katolicka lecz złodziejska.  (c)PP
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAknqE5EACgkQNdzY8sm9K9xsHwCeJhgMydNi4jw9RfNmu571aya+
lwMAoJJIflw/4kVnJ33G4Xte60MHUqGE
=/lR+
-----END PGP SIGNATURE-----


----------------------------------------------------------------------
Najlepsze dzwonki MP3 na telefon komorkowy!
Sprawdz >> http://link.interia.pl/f2128  

[-- Attachment #2: stlman.vcf --]
[-- Type: text/x-vcard, Size: 177 bytes --]

begin:vcard
fn;quoted-printable:=C5=81ukasz Stelmach
n;quoted-printable:Stelmach;=C5=81ukasz
email;internet:stlman@poczta.fm
x-mozilla-html:FALSE
version:2.1
end:vcard


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] use multitouch touchpad events as buttons mousedev
  2009-04-18 17:53   ` Lukasz Stelmach
@ 2009-04-18 22:13     ` Dmitry Torokhov
  0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2009-04-18 22:13 UTC (permalink / raw)
  To: Lukasz Stelmach; +Cc: LKML

On Sat, Apr 18, 2009 at 07:53:22PM +0200, Lukasz Stelmach wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Dmitry Torokhov pisze:
> > Hi Lukasz,
> > 
> > On Mon, Mar 09, 2009 at 02:03:22AM +0100, Lukasz Stelmach wrote:
> >> Some touchpads can recognize multi-finger taps. They can be used as
> >> additional buttons (left and middle).
> >>
> > 
> > mousedev is a legacy interface and I don't think this change is needed
> > since evdev + Synaptics X driver combination works much better with
> > touchpads anyway.
> 
> That is true, however, I happen to use plain old virtual terminal with
> gpm which uses mousedev. Having that multitouch buttons is, I assure you,
> awesome.
> 

I see. In this case I suggest switching GPM to use evdev protocol. Since
I added what I cosider proper evdev support for GPM a few years ago it
should work OK without need to patch mousedev.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-04-18 22:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-09  1:03 [PATCH] use multitouch touchpad events as buttons mousedev Lukasz Stelmach
2009-04-16  2:11 ` Dmitry Torokhov
2009-04-18 17:53   ` Lukasz Stelmach
2009-04-18 22:13     ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox