HID: wacom: generic: Reset events back to zero when pen leaves

As a pen leaves, we need to be sure to reset all events back to zero
so that userspace is able to get the complete pen state when it enters
proximity again.

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Ping Cheng <ping.cheng@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
Jason Gerecke 2017-09-07 17:52:15 -07:00 committed by Jiri Kosina
parent 3e70969e44
commit 5b40104edf
1 changed files with 4 additions and 4 deletions

View File

@ -2218,10 +2218,10 @@ static void wacom_wac_pen_event(struct hid_device *hdev, struct hid_field *field
return; return;
/* send pen events only when the pen is in range */ /* send pen events only when the pen is in range */
if (!wacom_wac->hid_data.inrange_state) if (wacom_wac->hid_data.inrange_state)
return; input_event(input, usage->type, usage->code, value);
else if (wacom_wac->shared->stylus_in_proximity && !wacom_wac->hid_data.sense_state)
input_event(input, usage->type, usage->code, value); input_event(input, usage->type, usage->code, 0);
} }
static void wacom_wac_pen_pre_report(struct hid_device *hdev, static void wacom_wac_pen_pre_report(struct hid_device *hdev,