From 9aea1c5fa09c25ad83bcf2fd4ee4bd853d889e5e Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 21 Dec 2010 10:53:06 +1000 Subject: Add use_proximity bit for BTN_TOOL handling. Touchpads send garbage data between BTN_TOOL_FINGER and BTN_TOUCH. This leads to cursor movement towards invalid positions (bottom left corner, usually). Add a new flag "use_proximity" as a delimiter for BTN_TOUCH handling. If unset, the actual proximity bits are ignored, no proximity events are sent and BTN_TOUCH is used for the tool handling. Example event stream for synaptics: Event: time 1292893041.002731, -------------- Report Sync ------------ Event: time 1292893041.015807, type 1 (Key), code 330 (Touch), value 0 Event: time 1292893041.015812, type 3 (Absolute), code 0 (X), value 4283 Event: time 1292893041.015813, type 3 (Absolute), code 1 (Y), value 4860 Event: time 1292893041.015815, type 3 (Absolute), code 24 (Pressure), value 23 Event: time 1292893041.015817, type 3 (Absolute), code 28 (Tool Width), value 5 Event: time 1292893041.027537, -------------- Report Sync ------------ Event: time 1292893041.038854, type 3 (Absolute), code 0 (X), value 1 Event: time 1292893041.038857, type 3 (Absolute), code 1 (Y), value 5855 Event: time 1292893041.038859, type 3 (Absolute), code 24 (Pressure), value 1 Event: time 1292893041.038861, type 3 (Absolute), code 28 (Tool Width), value 5 Event: time 1292893041.038864, -------------- Report Sync ------------ Event: time 1292893041.062432, type 3 (Absolute), code 24 (Pressure), value 0 Event: time 1292893041.062435, type 3 (Absolute), code 28 (Tool Width), value 0 Event: time 1292893041.062437, type 1 (Key), code 325 (ToolFinger), value 0 Event: time 1292893041.062438, -------------- Report Sync ------------ Reported-by: Dave Airlie Signed-off-by: Peter Hutterer Reviewed-by: Chris Bagwell --- src/evdev.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/evdev.h') diff --git a/src/evdev.h b/src/evdev.h index b04f961..f640fdd 100644 --- a/src/evdev.h +++ b/src/evdev.h @@ -126,6 +126,7 @@ typedef struct { int flags; int in_proximity; /* device in proximity */ + int use_proximity; /* using the proximity bit? */ int num_buttons; /* number of buttons */ BOOL swap_axes; BOOL invert_x; -- cgit v1.2.3