From 73b3577d5dc80bf5f079ddd5c0449459a1997765 Mon Sep 17 00:00:00 2001 From: Stefan Achatz Date: Wed, 19 May 2010 13:53:22 +0200 Subject: HID: roccat: fix special button support Added new data and changed workaround for abnormal button behaviour according to new gained knowledge about Roccat Kone device. Signed-off-by: Stefan Achatz Signed-off-by: Jiri Kosina --- drivers/hid/hid-roccat-kone.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'drivers/hid/hid-roccat-kone.c') diff --git a/drivers/hid/hid-roccat-kone.c b/drivers/hid/hid-roccat-kone.c index a41df9ab2877..5d9ced0defa5 100644 --- a/drivers/hid/hid-roccat-kone.c +++ b/drivers/hid/hid-roccat-kone.c @@ -928,14 +928,15 @@ static int kone_raw_event(struct hid_device *hdev, struct hid_report *report, return 0; /* - * Firmware 1.38 introduced new behaviour for tilt buttons. - * Pressed tilt button is reported in each movement event. + * Firmware 1.38 introduced new behaviour for tilt and special buttons. + * Pressed button is reported in each movement event. * Workaround sends only one event per press. */ - if (kone->last_tilt_state == event->tilt) - event->tilt = 0; + if (memcmp(&kone->last_mouse_event.tilt, &event->tilt, 5)) + memcpy(&kone->last_mouse_event, event, + sizeof(struct kone_mouse_event)); else - kone->last_tilt_state = event->tilt; + memset(&event->tilt, 0, 5); /* * handle special events and keep actual profile and dpi values -- cgit v1.2.3