summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Klausner <wiz@NetBSD.org>2013-08-19 19:30:37 +0200
committerThomas Klausner <wiz@NetBSD.org>2014-03-30 22:23:43 +0200
commit4e79eb64e50bf19d984a27af1dedaa78c1e77072 (patch)
tree746f8b8d4d0c75e319df77b60891c0f5825a8fee
parentb77a728904d5492163728762d4f363554edefba5 (diff)
downloadxorg-driver-xf86-input-mouse-4e79eb64e50bf19d984a27af1dedaa78c1e77072.tar.gz
Add support for absolute positioning (tablets).
From Pierre Pronchery <khorben@NetBSD.org> and review comments by Daniel Stone <daniel@fooishbar.org>. Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
-rw-r--r--src/bsd_mouse.c22
1 files changed, 21 insertions, 1 deletions
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))
@@ -432,6 +432,26 @@ wsconsReadInput(InputInfoPtr pInfo)
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,
"%s: bad wsmouse event type=%d\n", pInfo->name,