summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/arch/zaurus/dev/zts.c9
-rw-r--r--sys/dev/hil/hilms.c27
-rw-r--r--sys/dev/usb/uts.c6
3 files changed, 23 insertions, 19 deletions
diff --git a/sys/arch/zaurus/dev/zts.c b/sys/arch/zaurus/dev/zts.c
index 182662f7a91..7cf51ebeceb 100644
--- a/sys/arch/zaurus/dev/zts.c
+++ b/sys/arch/zaurus/dev/zts.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: zts.c,v 1.16 2014/03/29 18:09:30 guenther Exp $ */
+/* $OpenBSD: zts.c,v 1.17 2016/06/05 20:15:54 bru Exp $ */
/*
* Copyright (c) 2005 Dale Rahn <drahn@openbsd.org>
*
@@ -544,10 +544,9 @@ zts_irq(void *v)
DPRINTF(("%s: tp.z = %d, tp.x = %d, tp.y = %d\n",
sc->sc_dev.dv_xname, tp.z, tp.x, tp.y));
- wsmouse_input(sc->sc_wsmousedev, down, tp.x, tp.y,
- 0 /* z */, 0 /* w */,
- WSMOUSE_INPUT_ABSOLUTE_X | WSMOUSE_INPUT_ABSOLUTE_Y |
- WSMOUSE_INPUT_ABSOLUTE_Z);
+ wsmouse_buttons(sc->sc_wsmousedev, down);
+ wsmouse_position(sc->sc_wsmousedev, tp.x, tp.y);
+ wsmouse_input_sync(sc->sc_wsmousedev);
sc->sc_buttons = down;
sc->sc_oldx = tp.x;
sc->sc_oldy = tp.y;
diff --git a/sys/dev/hil/hilms.c b/sys/dev/hil/hilms.c
index 4251ae419c2..a59b7949925 100644
--- a/sys/dev/hil/hilms.c
+++ b/sys/dev/hil/hilms.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hilms.c,v 1.5 2007/04/10 22:37:17 miod Exp $ */
+/* $OpenBSD: hilms.c,v 1.6 2016/06/05 20:15:54 bru Exp $ */
/*
* Copyright (c) 2003, Miodrag Vallat.
* All rights reserved.
@@ -219,7 +219,7 @@ void
hilms_callback(struct hildev_softc *dev, u_int buflen, u_int8_t *buf)
{
struct hilms_softc *sc = (struct hilms_softc *)dev;
- int type, flags;
+ int type;
int dx, dy, dz, button;
#ifdef DIAGNOSTIC
int minlen;
@@ -256,9 +256,6 @@ hilms_callback(struct hildev_softc *dev, u_int buflen, u_int8_t *buf)
*/
if (type & HIL_MOUSEMOTION) {
- flags = sc->sc_features & HIL_ABSOLUTE ?
- WSMOUSE_INPUT_ABSOLUTE_X | WSMOUSE_INPUT_ABSOLUTE_Y |
- WSMOUSE_INPUT_ABSOLUTE_Z : WSMOUSE_INPUT_DELTA;
if (sc->sc_features & HIL_16_BITS) {
dx = *buf++;
dx |= (*buf++) << 8;
@@ -302,8 +299,7 @@ hilms_callback(struct hildev_softc *dev, u_int buflen, u_int8_t *buf)
if ((sc->sc_features & HIL_ABSOLUTE) == 0 &&
sc->sc_buttons == 0)
dy = -dy;
- } else
- dx = dy = dz = flags = 0;
+ }
if (type & HIL_MOUSEBUTTON) {
button = *buf;
@@ -332,7 +328,18 @@ hilms_callback(struct hildev_softc *dev, u_int buflen, u_int8_t *buf)
/* buf++; */
}
- if (sc->sc_wsmousedev != NULL)
- wsmouse_input(sc->sc_wsmousedev,
- sc->sc_buttonstate, dx, dy, dz, 0, flags);
+ if (sc->sc_wsmousedev == NULL)
+ return;
+
+ wsmouse_buttons(sc->sc_wsmousedev, sc->sc_buttonstate);
+ if (type & HIL_MOUSEMOTION) {
+ if ((sc->sc_features & HIL_ABSOLUTE) == 0) {
+ wsmouse_motion(sc->sc_wsmousedev, dx, dy, dz, 0);
+ } else {
+ wsmouse_position(sc->sc_wsmousedev, dx, dy);
+ if (sc->sc_axes > 2)
+ wsmouse_touch(sc->sc_wsmousedev, dz, 0);
+ }
+ }
+ wsmouse_input_sync(sc->sc_wsmousedev);
}
diff --git a/sys/dev/usb/uts.c b/sys/dev/usb/uts.c
index cc13d844f33..f3dfd36d278 100644
--- a/sys/dev/usb/uts.c
+++ b/sys/dev/usb/uts.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uts.c,v 1.37 2016/02/10 05:49:50 guenther Exp $ */
+/* $OpenBSD: uts.c,v 1.38 2016/06/05 20:15:54 bru Exp $ */
/*
* Copyright (c) 2007 Robert Nagy <robert@openbsd.org>
@@ -476,9 +476,7 @@ uts_intr(struct usbd_xfer *xfer, void *addr, usbd_status status)
DPRINTF(("%s: tp.down = %d, tp.z = %d, tp.x = %d, tp.y = %d\n",
sc->sc_dev.dv_xname, tp.down, tp.z, tp.x, tp.y));
- wsmouse_input(sc->sc_wsmousedev, tp.down, tp.x, tp.y, tp.z, 0,
- WSMOUSE_INPUT_ABSOLUTE_X | WSMOUSE_INPUT_ABSOLUTE_Y |
- WSMOUSE_INPUT_ABSOLUTE_Z);
+ WSMOUSE_TOUCH(sc->sc_wsmousedev, tp.down, tp.x, tp.y, tp.z, 0);
sc->sc_oldy = tp.y;
sc->sc_oldx = tp.x;