Skip to content

Commit

Permalink
HID: magicmouse: Don't report REL_{X,Y} for Magic Trackpad
Browse files Browse the repository at this point in the history
With the recent switch to having the hid layer handle standard axis
initialization, the Magic Trackpad now reports relative axes. This would
be fine in the normal mode, but the driver puts the device in multitouch
mode where no relative events are generated. Also, userspace software
depends on accurate axis information for device type detection. Thus,
ignoring the relative axes from the Magic Trackpad is best.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Chase Douglas authored and Jiri Kosina committed Dec 9, 2010
1 parent 59e57c6 commit 6a66bbd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/hid/hid-magicmouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,11 @@ static int magicmouse_input_mapping(struct hid_device *hdev,
if (!msc->input)
msc->input = hi->input;

/* Magic Trackpad does not give relative data after switching to MT */
if (hi->input->id.product == USB_DEVICE_ID_APPLE_MAGICTRACKPAD &&
field->flags & HID_MAIN_ITEM_RELATIVE)
return -1;

return 0;
}

Expand Down

0 comments on commit 6a66bbd

Please sign in to comment.