diff options
author | Ulf Brosziewski <bru@cvs.openbsd.org> | 2016-03-30 23:33:35 +0000 |
---|---|---|
committer | Ulf Brosziewski <bru@cvs.openbsd.org> | 2016-03-30 23:33:35 +0000 |
commit | 5ee2933ce26d20ba20e11285a742043fd5e3cbea (patch) | |
tree | 2d75c08000187c8c7ae18a8273607ea65e7f711d /driver/xf86-input-synaptics | |
parent | c938bcb7c97ee556bf9ed3de8abe5ce44e6addca (diff) |
Handle the TOUCH events from wsmouse.
With the changes for multitouch input, new event types have been
introduced in wsmouse. There are separate types for contact count
and width values, and RESET events for controlling/stopping
pointer motion.
ok mpi@, shadchin@
Diffstat (limited to 'driver/xf86-input-synaptics')
-rw-r--r-- | driver/xf86-input-synaptics/src/wsconscomm.c | 52 |
1 files changed, 18 insertions, 34 deletions
diff --git a/driver/xf86-input-synaptics/src/wsconscomm.c b/driver/xf86-input-synaptics/src/wsconscomm.c index c7a6aece0..5a8e4b3c7 100644 --- a/driver/xf86-input-synaptics/src/wsconscomm.c +++ b/driver/xf86-input-synaptics/src/wsconscomm.c @@ -215,45 +215,29 @@ WSConsReadHwState(InputInfoPtr pInfo, hw->y = priv->maxy - event->value + priv->miny; hw->cumulative_dy = hw->y; break; - case WSCONS_EVENT_MOUSE_ABSOLUTE_Z: + case WSCONS_EVENT_TOUCH_PRESSURE: hw->z = event->value; break; - case WSCONS_EVENT_MOUSE_ABSOLUTE_W: - if (priv->model == MODEL_ELANTECH) { - /* Elantech touchpads report number of fingers directly. */ - hw->fingerWidth = 5; - hw->numFingers = event->value; - break; - } - /* XXX magic number mapping which is mirrored in pms driver */ - switch (event->value) { - case 0: - hw->fingerWidth = 5; - hw->numFingers = 2; - break; - case 1: + case WSCONS_EVENT_TOUCH_CONTACTS: + hw->numFingers = event->value; + if (hw->numFingers == 0) + hw->fingerWidth = 0; + else if (hw->fingerWidth == 0) hw->fingerWidth = 5; - hw->numFingers = 3; - break; - case 4 ... 5: - hw->fingerWidth = event->value; - hw->numFingers = 1; - break; - } + break; + case WSCONS_EVENT_TOUCH_WIDTH: + hw->fingerWidth = event->value; + break; + case WSCONS_EVENT_TOUCH_RESET: + /* + * The contact count or the active MT-slot has changed. + * Suppress pointer motion and two-finger scrolling. + */ + priv->count_packet_finger = 0; + priv->vert_scroll_twofinger_on = FALSE; + priv->horiz_scroll_twofinger_on = FALSE; break; case WSCONS_EVENT_SYNC: - if (hw->z == 0) { - hw->fingerWidth = 0; - hw->numFingers = 0; - } else if (hw->numFingers == 0) { - /* - * Because W may be 0 already, a two-finger touch on a - * Synaptics touchpad doesn't necessarily produce an update - * event for W. - */ - hw->fingerWidth = 5; - hw->numFingers = 2; - } hw->millis = 1000 * event->time.tv_sec + event->time.tv_nsec / 1000000; SynapticsCopyHwState(hwRet, hw); |