Date: Tue, 15 Jan 2002 01:34:08 +0300 From: Juriy Goloveshkin <j@gu.ru> To: freebsd-mobile@freebsd.org Subject: vaio's jogdial & moused Message-ID: <20020114223408.GA4272@aviaport.ru>
next in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
I made a little hack for moused to use jogdial like a wheel.
maybe it will be useful for somebody who use /dev/sysmouse in X.
to use it, run "moused -t jogdial -p /dev/jogdial"
--
bye
Juriy Goloveshkin
[-- Attachment #2 --]
diff -ruN /usr/src/sys/sys/mouse.h.orig /usr/src/sys/sys/mouse.h
--- /usr/src/sys/sys/mouse.h.orig Thu Jul 5 19:38:36 2001
+++ /usr/src/sys/sys/mouse.h Tue Jan 15 01:18:39 2002
@@ -158,6 +158,7 @@
#define MOUSE_PROTO_X10MOUSEREM 13 /* X10 MouseRemote, 3 bytes */
#define MOUSE_PROTO_KIDSPAD 14 /* Genius Kidspad */
#define MOUSE_PROTO_VERSAPAD 15 /* Interlink VersaPad, 6 bytes */
+#define MOUSE_PROTO_JOGDIAL 16 /* Vaio's JogDial */
#define MOUSE_RES_UNKNOWN (-1)
#define MOUSE_RES_DEFAULT 0
diff -ruN /usr/src/usr.sbin/moused.orig/moused.c /usr/src/usr.sbin/moused/moused.c
--- /usr/src/usr.sbin/moused.orig/moused.c Wed Aug 29 00:22:14 2001
+++ /usr/src/usr.sbin/moused/moused.c Tue Jan 15 01:13:50 2002
@@ -200,6 +200,8 @@
"sysmouse",
"x10mouseremote",
"kidspad",
+ "foo", // hmmm...
+ "jogdial",
#if notyet
"mariqua",
#endif
@@ -362,6 +364,7 @@
(CS7 | CREAD | CLOCAL | HUPCL ), /* X10 MouseRemote */
(CS8 | PARENB | PARODD | CREAD | CLOCAL | HUPCL ), /* kidspad etc. */
(CS8 | CREAD | CLOCAL | HUPCL ), /* VersaPad */
+ 0, /* JogDial */
#if notyet
(CS8 | CSTOPB | CREAD | CLOCAL | HUPCL ), /* Mariqua */
#endif
@@ -1082,6 +1085,7 @@
{ 0x40, 0x40, 0x40, 0x00, 3, ~0x23, 0x00 }, /* X10 MouseRem */
{ 0x80, 0x80, 0x00, 0x00, 5, 0x00, 0xff }, /* KIDSPAD */
{ 0xc3, 0xc0, 0x00, 0x00, 6, 0x00, 0xff }, /* VersaPad */
+ { 0x00, 0x00, 0x00, 0x00, 1, 0x00, 0xff }, /* JogDial */
#if notyet
{ 0xf8, 0x80, 0x00, 0x00, 5, ~0x2f, 0x10 }, /* Mariqua */
#endif
@@ -1361,6 +1365,8 @@
}
break;
+ case MOUSE_PROTO_JOGDIAL:
+ break;
case MOUSE_PROTO_MSC:
setmousespeed(1200, rodent.baudrate, rodentcflags[rodent.rtype]);
if (rodent.flags & ClearDTR) {
@@ -1618,6 +1624,8 @@
*/
break;
#endif /* notyet */
+ case MOUSE_PROTO_JOGDIAL:
+ break;
/*
* IntelliMouse, NetMouse (including NetMouse Pro) and Mie Mouse
@@ -1716,7 +1724,18 @@
act->dx = (char)(pBuf[1]) + (char)(pBuf[3]);
act->dy = - ((char)(pBuf[2]) + (char)(pBuf[4]));
break;
-
+
+ case MOUSE_PROTO_JOGDIAL: /* JogDial */
+ if (rBuf == 0x6c)
+ act->dz=-1;
+ if (rBuf == 0x72)
+ act->dz=1;
+ if (rBuf == 0x64)
+ act->button = MOUSE_BUTTON1DOWN;
+ if (rBuf == 0x75)
+ act->button = 0;
+ break;
+
case MOUSE_PROTO_HITTAB: /* MM HitTablet */
act->button = butmaphit[pBuf[0] & 0x07];
act->dx = (pBuf[0] & MOUSE_MM_XPOSITIVE) ? pBuf[1] : - pBuf[1];
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020114223408.GA4272>
