From b48f4c41c0d3386bba3e9d8fa3da91f18aae190b Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 11 Oct 2010 09:33:28 +1000 Subject: Add proximity support. When one of the tools comes into proximity, queue up a proximity event and send it accordingly. Includes special handling for tablets that do not send axes with tools (#29645) Some tablets send axis values, then EV_SYN, and in the next event the BTN_TOOL_PEN/BTN_TOUCH, etc. For these tablets, the cursor doesn't move as coordinates while not in proximity are ignored. Buffer coordinates received while out-of-proximity and if we get a proximity event without other coordinates, re-use the last ones received. X.Org Bug 29645 Signed-off-by: Peter Hutterer Reviewed-by: Chris Bagwell Reviewed-by: Benjamin Tissoires --- src/evdev.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/evdev.h') diff --git a/src/evdev.h b/src/evdev.h index b382670..af93d41 100644 --- a/src/evdev.h +++ b/src/evdev.h @@ -109,6 +109,7 @@ typedef struct { enum { EV_QUEUE_KEY, /* xf86PostKeyboardEvent() */ EV_QUEUE_BTN, /* xf86PostButtonEvent() */ + EV_QUEUE_PROXIMITY, /* xf86PostProximityEvent() */ } type; int key; /* May be either a key code or button number. */ int val; /* State of the key/button; pressed or released. */ @@ -131,7 +132,8 @@ typedef struct { BOOL invert_y; int delta[REL_CNT]; - unsigned int abs, rel; + unsigned int abs, rel, prox; + unsigned int abs_prox; /* valuators posted while out of prox? */ /* XKB stuff has to be per-device rather than per-driver */ #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 5 @@ -198,6 +200,7 @@ typedef struct { /* Event posting functions */ void EvdevQueueKbdEvent(InputInfoPtr pInfo, struct input_event *ev, int value); void EvdevQueueButtonEvent(InputInfoPtr pInfo, int button, int value); +void EvdevQueueProximityEvent(InputInfoPtr pInfo, int value); void EvdevPostButtonEvent(InputInfoPtr pInfo, int button, int value); void EvdevQueueButtonClicks(InputInfoPtr pInfo, int button, int count); void EvdevPostRelativeMotionEvents(InputInfoPtr pInfo, int num_v, int first_v, -- cgit v1.2.3