summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/wsmoused/mouse_protocols.c13
-rw-r--r--usr.sbin/wsmoused/mouse_protocols.h3
-rw-r--r--usr.sbin/wsmoused/wsmoused.c7
3 files changed, 15 insertions, 8 deletions
diff --git a/usr.sbin/wsmoused/mouse_protocols.c b/usr.sbin/wsmoused/mouse_protocols.c
index ca0a3061afb..b0da3878070 100644
--- a/usr.sbin/wsmoused/mouse_protocols.c
+++ b/usr.sbin/wsmoused/mouse_protocols.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mouse_protocols.c,v 1.11 2006/04/17 08:42:41 deraadt Exp $ */
+/* $OpenBSD: mouse_protocols.c,v 1.12 2007/04/10 22:37:17 miod Exp $ */
/*
* Copyright (c) 2001 Jean-Baptiste Marchand, Julien Montagne and Jerome Verdon
@@ -985,15 +985,15 @@ mouse_protocol(u_char rBuf, mousestatus_t * act)
break;
default:
- act->dx = act->dy = act->dz = 0;
+ act->dx = act->dy = act->dz = act->dw = 0;
act->obutton = act->button;
act->button = butmapmss2[(rBuf & MOUSE_MSS_BUTTONS) >> 4]
| (act->obutton & (MOUSE_BUTTON1DOWN | MOUSE_BUTTON3DOWN));
break;
}
- act->flags = ((act->dx || act->dy || act->dz) ? MOUSE_POSCHANGED : 0)
- | (act->obutton ^ act->button);
+ act->flags = ((act->dx || act->dy || act->dz || act->dw) ?
+ MOUSE_POSCHANGED : 0) | (act->obutton ^ act->button);
pBufP = 0;
return act->flags;
}
@@ -1013,6 +1013,7 @@ mouse_protocol(u_char rBuf, mousestatus_t * act)
pBuf[4], pBuf[5], pBuf[6], pBuf[7]);
act->dz = 0;
+ act->dw = 0;
act->obutton = act->button;
switch (mouse.proto) {
case P_MS: /* Microsoft */
@@ -1060,7 +1061,7 @@ mouse_protocol(u_char rBuf, mousestatus_t * act)
* byte in some protocols. See above.
*/
/* has something changed? */
- act->flags = ((act->dx || act->dy || act->dz) ? MOUSE_POSCHANGED : 0) |
- (act->obutton ^ act->button);
+ act->flags = ((act->dx || act->dy || act->dz || act->dw) ?
+ MOUSE_POSCHANGED : 0) | (act->obutton ^ act->button);
return act->flags;
}
diff --git a/usr.sbin/wsmoused/mouse_protocols.h b/usr.sbin/wsmoused/mouse_protocols.h
index f14f55bee20..14a2ab64451 100644
--- a/usr.sbin/wsmoused/mouse_protocols.h
+++ b/usr.sbin/wsmoused/mouse_protocols.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: mouse_protocols.h,v 1.4 2003/11/08 19:17:30 jmc Exp $ */
+/* $OpenBSD: mouse_protocols.h,v 1.5 2007/04/10 22:37:17 miod Exp $ */
/*
* Copyright (c) 2001 Jean-Baptiste Marchand, Julien Montagne and Jerome Verdon
@@ -193,6 +193,7 @@ typedef struct mousestatus {
int dx; /* x movement */
int dy; /* y movement */
int dz; /* z movement */
+ int dw; /* w movement */
} mousestatus_t;
/* Prototypes */
diff --git a/usr.sbin/wsmoused/wsmoused.c b/usr.sbin/wsmoused/wsmoused.c
index 760c64b282b..a468b986ce4 100644
--- a/usr.sbin/wsmoused/wsmoused.c
+++ b/usr.sbin/wsmoused/wsmoused.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsmoused.c,v 1.20 2006/04/17 08:42:41 deraadt Exp $ */
+/* $OpenBSD: wsmoused.c,v 1.21 2007/04/10 22:37:17 miod Exp $ */
/*
* Copyright (c) 2001 Jean-Baptiste Marchand, Julien Montagne and Jerome Verdon
@@ -357,6 +357,11 @@ split_event(mousestatus_t *act)
event.value = act->dz;
treat_event(&event);
}
+ if (act->dw != 0) {
+ event.type = WSCONS_EVENT_MOUSE_DELTA_W;
+ event.value = act->dw;
+ treat_event(&event);
+ }
/* buttons state */
mask = act->flags & MOUSE_BUTTONS;