linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 09/19] input: bcm5974: Add quad-finger tapping
@ 2009-02-11 21:23 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2009-02-11 21:23 UTC (permalink / raw)
  To: dtor; +Cc: linux-input, akpm, rydberg

From: "Henrik Rydberg" <rydberg@euromail.se>

The integrated button on the new unibody Macbooks presents a need to
report explicit four-finger actions.  Evidently, the finger pressing the
button is also touching the trackpad, so in order to fully support
three-finger actions, the driver must be able to report four-finger
actions.  This patch adds a new button, BTN_TOOL_QUADTAP, which achieves
this.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Cc: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/input/mouse/bcm5974.c |    4 +++-
 include/linux/input.h         |    1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff -puN drivers/input/mouse/bcm5974.c~input-bcm5974-add-quad-finger-tapping drivers/input/mouse/bcm5974.c
--- a/drivers/input/mouse/bcm5974.c~input-bcm5974-add-quad-finger-tapping
+++ a/drivers/input/mouse/bcm5974.c
@@ -258,6 +258,7 @@ static void setup_events_to_report(struc
 	__set_bit(BTN_TOOL_FINGER, input_dev->keybit);
 	__set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit);
 	__set_bit(BTN_TOOL_TRIPLETAP, input_dev->keybit);
+	__set_bit(BTN_TOOL_QUADTAP, input_dev->keybit);
 	__set_bit(BTN_LEFT, input_dev->keybit);
 }
 
@@ -328,7 +329,8 @@ static int report_tp_state(struct bcm597
 	input_report_key(input, BTN_TOUCH, dev->fingers > 0);
 	input_report_key(input, BTN_TOOL_FINGER, dev->fingers == 1);
 	input_report_key(input, BTN_TOOL_DOUBLETAP, dev->fingers == 2);
-	input_report_key(input, BTN_TOOL_TRIPLETAP, dev->fingers > 2);
+	input_report_key(input, BTN_TOOL_TRIPLETAP, dev->fingers == 3);
+	input_report_key(input, BTN_TOOL_QUADTAP, dev->fingers > 3);
 
 	input_report_abs(input, ABS_PRESSURE, abs_p);
 	input_report_abs(input, ABS_TOOL_WIDTH, abs_w);
diff -puN include/linux/input.h~input-bcm5974-add-quad-finger-tapping include/linux/input.h
--- a/include/linux/input.h~input-bcm5974-add-quad-finger-tapping
+++ a/include/linux/input.h
@@ -445,6 +445,7 @@ struct input_absinfo {
 #define BTN_STYLUS2		0x14c
 #define BTN_TOOL_DOUBLETAP	0x14d
 #define BTN_TOOL_TRIPLETAP	0x14e
+#define BTN_TOOL_QUADTAP	0x14f	/* Four fingers on trackpad */
 
 #define BTN_WHEEL		0x150
 #define BTN_GEAR_DOWN		0x150
_

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

only message in thread, other threads:[~2009-02-11 21:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-11 21:23 [patch 09/19] input: bcm5974: Add quad-finger tapping akpm

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