Skip to content

Commit

Permalink
Input: bcm5974 - add quad-finger tapping
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
  • Loading branch information
Henrik Rydberg authored and Dmitry Torokhov committed Apr 28, 2009
1 parent 9894cf0 commit 6916d97
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/input/mouse/bcm5974.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ static void setup_events_to_report(struct input_dev *input_dev,
__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);
}

Expand Down Expand Up @@ -329,7 +330,8 @@ static int report_tp_state(struct bcm5974 *dev, int size)
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);
Expand Down
1 change: 1 addition & 0 deletions include/linux/input.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6916d97

Please sign in to comment.