lkml.org 
[lkml]   [2012]   [Jan]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
SubjectRe: [PATCH v2 1/3] hid-multitouch: add support for trackpads
Hi Benjamin,

> @@ -389,9 +404,19 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi,
> td->last_field_index = field->index;
> return -1;
> }
> + case HID_DG_TOUCH:
> + /* Legacy devices use TIPSWITCH and not TOUCH.
> + * Let's just ignore this field. */
> + return -1;
> /* let hid-input decide for the others */
> return 0;
>
> + case HID_UP_BUTTON:
> + code = ((usage->hid - 1) & HID_USAGE) + BTN_MOUSE;

Why '+' here instead of '|' is beyond me...

> + hid_map_usage(hi, usage, bit, max, EV_KEY, code);
> + input_set_capability(hi->input, EV_KEY, code);
> + return 1;
> +
> case 0xff000000:
> /* we do not want to map these: no input-oriented meaning */
> return -1;
> @@ -453,6 +478,7 @@ static void mt_complete_slot(struct mt_device *td)
> static void mt_emit_event(struct mt_device *td, struct input_dev *input)
> {
> int i;
> + int finger_count = 0;
>
> for (i = 0; i < td->maxcontacts; ++i) {
> struct mt_slot *s = &(td->slots[i]);
> @@ -477,12 +503,14 @@ static void mt_emit_event(struct mt_device *td, struct input_dev *input)
> input_event(input, EV_ABS, ABS_MT_PRESSURE, s->p);
> input_event(input, EV_ABS, ABS_MT_TOUCH_MAJOR, major);
> input_event(input, EV_ABS, ABS_MT_TOUCH_MINOR, minor);
> + finger_count++;
> }
> s->seen_in_this_frame = false;
>
> }
>
> input_mt_report_pointer_emulation(input, true);
> + input_mt_report_finger_count(input, finger_count);

This function is already called from input_mt_report_pointer_emulation().

> input_sync(input);
> td->num_received = 0;
> }

Thanks,
Henrik


\
 
 \ /
  Last update: 2012-01-20 17:11    [W:0.087 / U:5.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site