From 4e79eb64e50bf19d984a27af1dedaa78c1e77072 Mon Sep 17 00:00:00 2001 From: Thomas Klausner Date: Mon, 19 Aug 2013 19:30:37 +0200 Subject: Add support for absolute positioning (tablets). From Pierre Pronchery and review comments by Daniel Stone . Reviewed-by: Daniel Stone Signed-off-by: Thomas Klausner --- src/bsd_mouse.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/bsd_mouse.c b/src/bsd_mouse.c index 98e5ff3..a2c8ec7 100644 --- a/src/bsd_mouse.c +++ b/src/bsd_mouse.c @@ -407,7 +407,7 @@ wsconsReadInput(InputInfoPtr pInfo) n /= sizeof(struct wscons_event); while( n-- ) { int buttons = pMse->lastButtons; - int dx = 0, dy = 0, dz = 0, dw = 0; + int dx = 0, dy = 0, dz = 0, dw = 0, x, y; switch (event->type) { case WSCONS_EVENT_MOUSE_UP: #define BUTBIT (1 << (event->value <= 2 ? 2 - event->value : event->value)) @@ -431,6 +431,26 @@ wsconsReadInput(InputInfoPtr pInfo) case WSCONS_EVENT_MOUSE_DELTA_W: dw = event->value; break; +#endif + case WSCONS_EVENT_MOUSE_ABSOLUTE_X: + x = event->value; + xf86PostMotionEvent(pInfo->dev, TRUE, 0, 1, x); + ++event; + continue; + case WSCONS_EVENT_MOUSE_ABSOLUTE_Y: + y = event->value; + xf86PostMotionEvent(pInfo->dev, TRUE, 1, 1, y); + ++event; + continue; +#ifdef WSCONS_EVENT_MOUSE_ABSOLUTE_Z + case WSCONS_EVENT_MOUSE_ABSOLUTE_Z: + ++event; + continue; +#endif +#ifdef WSCONS_EVENT_MOUSE_ABSOLUTE_W + case WSCONS_EVENT_MOUSE_ABSOLUTE_W: + ++event; + continue; #endif default: LogMessageVerbSigSafe(X_WARNING, -1, -- cgit v1.2.3