linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] appletouch: Improved finger detection
@ 2009-05-05 19:10 Jeremy Huddleston
  2009-05-08  2:59 ` Dmitry Torokhov
  0 siblings, 1 reply; 5+ messages in thread
From: Jeremy Huddleston @ 2009-05-05 19:10 UTC (permalink / raw)
  To: linux-input

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

The appletouch driver is prone to reporting multiple fingers when only  
one is
pressing.  The appletouch driver queries an array of pressure sensors  
and
counts local maxima in pressure to determine the number of fingers.   
It just
does this on the raw values, so a data stream like:

0 100 250 300 299 300 250 100 0

actually registers as 2 fingers.

This patch updates the logic to ignore small dips in pressure that are  
less
than the threshold.

Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>

diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/ 
appletouch.c
index 454b961..9bb42f6 100644
--- a/drivers/input/mouse/appletouch.c
+++ b/drivers/input/mouse/appletouch.c
@@ -349,7 +349,7 @@ static int atp_calculate_abs(int *xy_sensors, int  
nb_sensors, int fact,
  		    (!is_increasing && xy_sensors[i - 1] < xy_sensors[i])) {
  			(*fingers)++;
  			is_increasing = 1;
-		} else if (i > 0 && xy_sensors[i - 1] >= xy_sensors[i]) {
+		} else if (i > 0 && (xy_sensors[i - 1] - xy_sensors[i] >  
threshold)) {
  			is_increasing = 0;
  		}



[-- Attachment #2: appletouch.patch --]
[-- Type: application/octet-stream, Size: 1058 bytes --]

The appletouch driver is prone to reporting multiple fingers when only one is
pressing.  The appletouch driver queries an array of pressure sensors and
counts local maxima in pressure to determine the number of fingers.  It just
does this on the raw values, so a data stream like:

0 100 250 300 299 300 250 100 0

actually registers as 2 fingers.

This patch updates the logic to ignore small dips in pressure that are less
than the threshold.

Signed off by: Jeremy Huddleston <jeremyhu@freedesktop.org>

diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c
index 454b961..9bb42f6 100644
--- a/drivers/input/mouse/appletouch.c
+++ b/drivers/input/mouse/appletouch.c
@@ -349,7 +349,7 @@ static int atp_calculate_abs(int *xy_sensors, int nb_sensors, int fact,
 		    (!is_increasing && xy_sensors[i - 1] < xy_sensors[i])) {
 			(*fingers)++;
 			is_increasing = 1;
-		} else if (i > 0 && xy_sensors[i - 1] >= xy_sensors[i]) {
+		} else if (i > 0 && (xy_sensors[i - 1] - xy_sensors[i] > threshold)) {
 			is_increasing = 0;
 		}
 

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



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

* Re: [PATCH] appletouch: Improved finger detection
  2009-05-05 19:10 [PATCH] appletouch: Improved finger detection Jeremy Huddleston
@ 2009-05-08  2:59 ` Dmitry Torokhov
  2009-05-08  6:13   ` Jeremy Huddleston
  2009-06-01  7:35   ` Jeremy Huddleston
  0 siblings, 2 replies; 5+ messages in thread
From: Dmitry Torokhov @ 2009-05-08  2:59 UTC (permalink / raw)
  To: Jeremy Huddleston; +Cc: linux-input

HI Jeremy,

On Tue, May 05, 2009 at 12:10:34PM -0700, Jeremy Huddleston wrote:
> The appletouch driver is prone to reporting multiple fingers when only  
> one is
> pressing.  The appletouch driver queries an array of pressure sensors  
> and
> counts local maxima in pressure to determine the number of fingers.  It 
> just
> does this on the raw values, so a data stream like:
>
> 0 100 250 300 299 300 250 100 0
>
> actually registers as 2 fingers.
>
> This patch updates the logic to ignore small dips in pressure that are  
> less
> than the threshold.
>

Does it still detect 2 fingers as 2 fingers when they are held together?

-- 
Dmitry

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

* Re: [PATCH] appletouch: Improved finger detection
  2009-05-08  2:59 ` Dmitry Torokhov
@ 2009-05-08  6:13   ` Jeremy Huddleston
  2009-06-01  7:35   ` Jeremy Huddleston
  1 sibling, 0 replies; 5+ messages in thread
From: Jeremy Huddleston @ 2009-05-08  6:13 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input

Dmitry Torokhov wrote:
> HI Jeremy,
> 
> On Tue, May 05, 2009 at 12:10:34PM -0700, Jeremy Huddleston wrote:
>> The appletouch driver is prone to reporting multiple fingers when only  
>> one is
>> pressing.  The appletouch driver queries an array of pressure sensors  
>> and
>> counts local maxima in pressure to determine the number of fingers.  It 
>> just
>> does this on the raw values, so a data stream like:
>>
>> 0 100 250 300 299 300 250 100 0
>>
>> actually registers as 2 fingers.
>>
>> This patch updates the logic to ignore small dips in pressure that are  
>> less
>> than the threshold.
>>
> 
> Does it still detect 2 fingers as 2 fingers when they are held together?
> 

Yes... and 3 when 3 are there.  Before, it would frequently report 3
instead of 2 or 2 instead of 1.  I have found the behavior with this
patch very reliable... the old behavior was not reliable for me (perhaps
due to a precision issue in hardware... or a dent in my finger).

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

* Re: [PATCH] appletouch: Improved finger detection
  2009-05-08  2:59 ` Dmitry Torokhov
  2009-05-08  6:13   ` Jeremy Huddleston
@ 2009-06-01  7:35   ` Jeremy Huddleston
  2009-06-02 11:29     ` Dmitry Torokhov
  1 sibling, 1 reply; 5+ messages in thread
From: Jeremy Huddleston @ 2009-06-01  7:35 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, johannes, jasonparekh


On May 7, 2009, at 19:59, Dmitry Torokhov wrote:

> HI Jeremy,
>
> On Tue, May 05, 2009 at 12:10:34PM -0700, Jeremy Huddleston wrote:
>> The appletouch driver is prone to reporting multiple fingers when  
>> only
>> one is
>> pressing.  The appletouch driver queries an array of pressure sensors
>> and
>> counts local maxima in pressure to determine the number of  
>> fingers.  It
>> just
>> does this on the raw values, so a data stream like:
>>
>> 0 100 250 300 299 300 250 100 0
>>
>> actually registers as 2 fingers.
>>
>> This patch updates the logic to ignore small dips in pressure that  
>> are
>> less
>> than the threshold.
>>
>
> Does it still detect 2 fingers as 2 fingers when they are held  
> together?

I just wanted to follow up on this patch[1], since I haven't seen any  
movement.  It's fairly trivial and I've been using it for the past  
month with great success (yes, it still detects 2 fingers properly).   
Is there hope that this change can get merged soon?

Thanks,
Jeremy

1: http://launchpadlibrarian.net/26305586/appletouch.patch


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

* Re: [PATCH] appletouch: Improved finger detection
  2009-06-01  7:35   ` Jeremy Huddleston
@ 2009-06-02 11:29     ` Dmitry Torokhov
  0 siblings, 0 replies; 5+ messages in thread
From: Dmitry Torokhov @ 2009-06-02 11:29 UTC (permalink / raw)
  To: Jeremy Huddleston; +Cc: linux-input, johannes, jasonparekh

On Monday 01 June 2009 00:35:53 Jeremy Huddleston wrote:
> On May 7, 2009, at 19:59, Dmitry Torokhov wrote:
> > HI Jeremy,
> >
> > On Tue, May 05, 2009 at 12:10:34PM -0700, Jeremy Huddleston wrote:
> >> The appletouch driver is prone to reporting multiple fingers when
> >> only
> >> one is
> >> pressing.  The appletouch driver queries an array of pressure sensors
> >> and
> >> counts local maxima in pressure to determine the number of
> >> fingers.  It
> >> just
> >> does this on the raw values, so a data stream like:
> >>
> >> 0 100 250 300 299 300 250 100 0
> >>
> >> actually registers as 2 fingers.
> >>
> >> This patch updates the logic to ignore small dips in pressure that
> >> are
> >> less
> >> than the threshold.
> >
> > Does it still detect 2 fingers as 2 fingers when they are held
> > together?
>
> I just wanted to follow up on this patch[1], since I haven't seen any
> movement.  It's fairly trivial and I've been using it for the past
> month with great success (yes, it still detects 2 fingers properly).
> Is there hope that this change can get merged soon?
>

Gah, I was sure I applied it to 'next'. Sorry about that, I will
make sure it gets into .31.

-- 
Dmitry

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

end of thread, other threads:[~2009-06-02 13:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-05 19:10 [PATCH] appletouch: Improved finger detection Jeremy Huddleston
2009-05-08  2:59 ` Dmitry Torokhov
2009-05-08  6:13   ` Jeremy Huddleston
2009-06-01  7:35   ` Jeremy Huddleston
2009-06-02 11:29     ` Dmitry Torokhov

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).