Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Absolute pointing device support.
details: https://anonhg.NetBSD.org/src/rev/4bfa4937514b
branches: trunk
changeset: 480263:4bfa4937514b
user: takemura <takemura%NetBSD.org@localhost>
date: Sat Jan 08 02:57:22 2000 +0000
description:
Absolute pointing device support.
- Wsmouse_input() get new argument 'flag', which indicates whether x/y/z are
relative or absolute.
- Wsmouse get new io controls, WSMOUSEIO_SCALIBCOORDS and
WSMOUSEIO_GCALIBCOORDS.
diffstat:
sys/arch/hpcmips/vr/vrpiu.c | 75 +++++++----------------------
sys/arch/hpcmips/vr/vrpiuvar.h | 6 +-
sys/arch/i386/isa/lms.c | 4 +-
sys/arch/i386/isa/mms.c | 4 +-
sys/arch/macppc/dev/ams.c | 5 +-
sys/dev/dec/vsxxx.c | 7 +-
sys/dev/dec/zsms.c | 4 +-
sys/dev/pckbc/psm.c | 5 +-
sys/dev/pckbc/psm_intelli.c | 5 +-
sys/dev/usb/ums.c | 5 +-
sys/dev/wscons/wsconsio.h | 19 +++++++-
sys/dev/wscons/wsmouse.c | 103 +++++++++++++++++++++++++++++-----------
sys/dev/wscons/wsmousevar.h | 8 ++-
13 files changed, 140 insertions(+), 110 deletions(-)
diffs (truncated from 551 to 300 lines):
diff -r 00df37d144dd -r 4bfa4937514b sys/arch/hpcmips/vr/vrpiu.c
--- a/sys/arch/hpcmips/vr/vrpiu.c Sat Jan 08 02:04:06 2000 +0000
+++ b/sys/arch/hpcmips/vr/vrpiu.c Sat Jan 08 02:57:22 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vrpiu.c,v 1.1 1999/12/28 03:15:18 takemura Exp $ */
+/* $NetBSD: vrpiu.c,v 1.2 2000/01/08 02:57:24 takemura Exp $ */
/*
* Copyright (c) 1999 Shin Takemura All rights reserved.
@@ -71,7 +71,6 @@
static int vrpiu_intr __P((void *));
static void vrpiu_reset_param __P((struct vrpiu_softc *sc));
-static void vrpiu_timeout __P((void *));
#ifdef DEBUG
static void vrpiu_dump_cntreg __P((unsigned int cmd));
#endif
@@ -260,8 +259,6 @@
sc->sc_stat = (cnt & PIUCNT_PENSTC) ?
VRPIU_STAT_TOUCH : VRPIU_STAT_RELEASE;
- sc->sc_timeout = 1;
-
splx(s);
return 0;
@@ -272,7 +269,6 @@
void *v;
{
struct vrpiu_softc *sc = v;
- int s;
DPRINTF(("%s(%d): vrpiu_disable()\n", __FILE__, __LINE__));
@@ -286,12 +282,6 @@
/* mask clock to PIU */
__vrcmu_supply(CMUMSKPIU, 1);
-
- s = spltty();
- if (!sc->sc_timeout) {
- untimeout(vrpiu_timeout, sc);
- }
- splx(s);
}
int
@@ -308,7 +298,7 @@
switch (cmd) {
case WSMOUSEIO_GTYPE:
- *(u_int *)data = WSMOUSE_TYPE_PS2;
+ *(u_int *)data = WSMOUSE_TYPE_TPANEL;
break;
case WSMOUSEIO_SRES:
@@ -391,34 +381,22 @@
*/
DPRINTF(("PEN TOUCH\n"));
sc->sc_stat = VRPIU_STAT_TOUCH;
- if (sc->sc_timeout) {
- sc->sc_timeout = 0;
- sc->sc_releasecount = 0;
- timeout(vrpiu_timeout, sc, hz/3);
- }
+ /* button 0 DOWN */
+ wsmouse_input(sc->sc_wsmousedev,
+ (1 << 0),
+ 0, 0, 0, 0);
}
} else {
- if (sc->sc_stat == VRPIU_STAT_TOUCH ||
- sc->sc_stat == VRPIU_STAT_DRAG) {
+ if (sc->sc_stat == VRPIU_STAT_TOUCH) {
/*
* pen release
*/
DPRINTF(("RELEASE\n"));
sc->sc_stat = VRPIU_STAT_RELEASE;
- if (!sc->sc_timeout) {
- if (++sc->sc_releasecount == 2) {
- untimeout(vrpiu_timeout, sc);
- sc->sc_timeout = 1;
- DPRINTF(("TAP!\n"));
- /* button 0 DOWN */
- wsmouse_input(sc->sc_wsmousedev,
- (1 << 0),
- 0, 0, 0);
- /* button 0 UP */
- wsmouse_input(sc->sc_wsmousedev,
- 0, 0, 0, 0);
- }
- }
+ /* button 0 UP */
+ wsmouse_input(sc->sc_wsmousedev,
+ 0,
+ 0, 0, 0, 0);
}
}
@@ -455,22 +433,13 @@
if (sc->sc_prmys <= y)
y = sc->sc_prmys - 1;
DPRINTF(("->%4d %4d", x, y));
- if (sc->sc_stat == VRPIU_STAT_TOUCH) {
- sc->sc_stat = VRPIU_STAT_DRAG;
- sc->sc_x = x;
- sc->sc_y = y;
- } else
- if (sc->sc_stat == VRPIU_STAT_DRAG) {
- DPRINTF((" delta %d %d",
- x - sc->sc_x, y - sc->sc_y));
- wsmouse_input(sc->sc_wsmousedev,
- 0, /* all buttons up */
- x - sc->sc_x, /* dx */
- y - sc->sc_y, /* dy */
- 0); /* dz */
- sc->sc_x = x;
- sc->sc_y = y;
- }
+ wsmouse_input(sc->sc_wsmousedev,
+ (cnt & PIUCNT_PENSTC) ? 1 : 0,
+ x, /* x */
+ y, /* y */
+ 0, /* z */
+ WSMOUSE_INPUT_ABSOLUTE_X |
+ WSMOUSE_INPUT_ABSOLUTE_Y);
DPRINTF(("\n"));
}
}
@@ -498,14 +467,6 @@
sc->sc_prmys = PIUPB_PADDATA_MAX;
}
-void
-vrpiu_timeout(arg)
- void *arg;
-{
- struct vrpiu_softc *sc = arg;
- sc->sc_timeout = 1;
-}
-
#ifdef DEBUG
void
vrpiu_dump_cntreg(cnt)
diff -r 00df37d144dd -r 4bfa4937514b sys/arch/hpcmips/vr/vrpiuvar.h
--- a/sys/arch/hpcmips/vr/vrpiuvar.h Sat Jan 08 02:04:06 2000 +0000
+++ b/sys/arch/hpcmips/vr/vrpiuvar.h Sat Jan 08 02:57:22 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vrpiuvar.h,v 1.1 1999/12/28 03:15:19 takemura Exp $ */
+/* $NetBSD: vrpiuvar.h,v 1.2 2000/01/08 02:57:25 takemura Exp $ */
/*
* Copyright (c) 1999 Shin Takemura All rights reserved.
@@ -31,7 +31,6 @@
VRPIU_STAT_DISABLE,
VRPIU_STAT_RELEASE,
VRPIU_STAT_TOUCH,
- VRPIU_STAT_DRAG,
};
struct vrpiu_softc {
@@ -43,9 +42,6 @@
enum vrpiu_stat sc_stat;
struct device *sc_wsmousedev;
- int sc_x, sc_y;
- int sc_timeout;
- int sc_releasecount;
/* correction parameters */
int sc_prmax, sc_prmbx, sc_prmcx, sc_prmxs;
diff -r 00df37d144dd -r 4bfa4937514b sys/arch/i386/isa/lms.c
--- a/sys/arch/i386/isa/lms.c Sat Jan 08 02:04:06 2000 +0000
+++ b/sys/arch/i386/isa/lms.c Sat Jan 08 02:57:22 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lms.c,v 1.37 1999/01/23 15:03:50 drochner Exp $ */
+/* $NetBSD: lms.c,v 1.38 2000/01/08 02:57:25 takemura Exp $ */
/*-
* Copyright (c) 1993, 1994 Charles M. Hannum.
@@ -248,7 +248,7 @@
if (dx || dy || changed)
wsmouse_input(sc->sc_wsmousedev,
- buttons, dx, dy, 0);
+ buttons, dx, dy, 0, WSMOUSE_INPUT_DELTA);
return -1;
}
diff -r 00df37d144dd -r 4bfa4937514b sys/arch/i386/isa/mms.c
--- a/sys/arch/i386/isa/mms.c Sat Jan 08 02:04:06 2000 +0000
+++ b/sys/arch/i386/isa/mms.c Sat Jan 08 02:57:22 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mms.c,v 1.34 1999/01/23 15:03:50 drochner Exp $ */
+/* $NetBSD: mms.c,v 1.35 2000/01/08 02:57:25 takemura Exp $ */
/*-
* Copyright (c) 1993, 1994 Charles M. Hannum.
@@ -242,7 +242,7 @@
if (dx || dy || changed)
wsmouse_input(sc->sc_wsmousedev,
- buttons, dx, dy, 0);
+ buttons, dx, dy, 0, WSMOUSE_INPUT_DELTA);
return -1;
}
diff -r 00df37d144dd -r 4bfa4937514b sys/arch/macppc/dev/ams.c
--- a/sys/arch/macppc/dev/ams.c Sat Jan 08 02:04:06 2000 +0000
+++ b/sys/arch/macppc/dev/ams.c Sat Jan 08 02:57:22 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ams.c,v 1.7 1999/08/16 06:28:09 tsubai Exp $ */
+/* $NetBSD: ams.c,v 1.8 2000/01/08 02:57:25 takemura Exp $ */
/*
* Copyright (C) 1998 Colin Wood
@@ -547,7 +547,8 @@
if (msc->sc_wsmousedev)
wsmouse_input(msc->sc_wsmousedev, new_event.u.m.buttons,
- new_event.u.m.dx, -new_event.u.m.dy, 0);
+ new_event.u.m.dx, -new_event.u.m.dy, 0,
+ WSMOUSE_INPUT_DELTA);
#if NAED > 0
aed_input(&new_event);
#endif
diff -r 00df37d144dd -r 4bfa4937514b sys/dev/dec/vsxxx.c
--- a/sys/dev/dec/vsxxx.c Sat Jan 08 02:04:06 2000 +0000
+++ b/sys/dev/dec/vsxxx.c Sat Jan 08 02:57:22 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vsxxx.c,v 1.1 1999/11/20 04:55:30 nisimura Exp $ */
+/* $NetBSD: vsxxx.c,v 1.2 2000/01/08 02:57:22 takemura Exp $ */
/*
* Copyright (c) 1999 Tohru Nishimura. All rights reserved.
@@ -32,7 +32,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: vsxxx.c,v 1.1 1999/11/20 04:55:30 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vsxxx.c,v 1.2 2000/01/08 02:57:22 takemura Exp $");
/*
* Common machinary for VSXXX mice and tablet
@@ -141,5 +141,6 @@
x = -x;
if ((sc->sc_report.raw[0] & VS_Y_SIGN) != 0)
y = -y; /* Eeeh? */
- wsmouse_input(sc->sc_wsmousedev, sc->sc_report.raw[0] & 07, x, y, 0);
+ wsmouse_input(sc->sc_wsmousedev, sc->sc_report.raw[0] & 07, x, y, 0,
+ WSMOUSE_INPUT_DELTA);
}
diff -r 00df37d144dd -r 4bfa4937514b sys/dev/dec/zsms.c
--- a/sys/dev/dec/zsms.c Sat Jan 08 02:04:06 2000 +0000
+++ b/sys/dev/dec/zsms.c Sat Jan 08 02:57:22 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: zsms.c,v 1.5 1999/10/26 18:20:44 drochner Exp $ */
+/* $NetBSD: zsms.c,v 1.6 2000/01/08 02:57:22 takemura Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -305,7 +305,7 @@
else
sc->dy = data;
wsmouse_input(sc->sc_wsmousedev, sc->buttons,
- sc->dx, sc->dy, 0);
+ sc->dx, sc->dy, 0, WSMOUSE_INPUT_DELTA);
}
return;
diff -r 00df37d144dd -r 4bfa4937514b sys/dev/pckbc/psm.c
--- a/sys/dev/pckbc/psm.c Sat Jan 08 02:04:06 2000 +0000
+++ b/sys/dev/pckbc/psm.c Sat Jan 08 02:57:22 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: psm.c,v 1.9 1999/12/03 22:48:25 thorpej Exp $ */
+/* $NetBSD: psm.c,v 1.10 2000/01/08 02:57:23 takemura Exp $ */
/*-
* Copyright (c) 1994 Charles M. Hannum.
@@ -319,7 +319,8 @@
if (sc->dx || dy || changed)
wsmouse_input(sc->sc_wsmousedev,
- sc->buttons, sc->dx, dy, 0);
+ sc->buttons, sc->dx, dy, 0,
+ WSMOUSE_INPUT_DELTA);
break;
}
diff -r 00df37d144dd -r 4bfa4937514b sys/dev/pckbc/psm_intelli.c
--- a/sys/dev/pckbc/psm_intelli.c Sat Jan 08 02:04:06 2000 +0000
+++ b/sys/dev/pckbc/psm_intelli.c Sat Jan 08 02:57:22 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: psm_intelli.c,v 1.6 1999/12/03 22:48:25 thorpej Exp $ */
+/* $NetBSD: psm_intelli.c,v 1.7 2000/01/08 02:57:23 takemura Exp $ */
/*-
* Copyright (c) 1994 Charles M. Hannum.
@@ -344,7 +344,8 @@
Home |
Main Index |
Thread Index |
Old Index